Dimensione: 4498
Commento:
|
Dimensione: 4843
Commento: converted to 1.6 markup
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 1: | Linea 1: |
#title KVM Installation <<Include(KVM/Header)>> ||<tablestyle="float:right; font-size: 0.9em; width:30%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;"><<TableOfContents(2)>>|| |
## page was renamed from Emulatori/Kvm/Installazione ## page was renamed from FabioMarconi/Prove7 ## last update 17-10-2010 #format wiki #language it <<Indice(depth=1)>> <<Informazioni(forum="http://forum.ubuntu-it.org/index.php/topic,371617.0.html")>> <<BR>> = Introduzione = In questa pagina verrà spiegato come installare '''KVM''', un programma di virtualizzazione del kernel Linux. = Preparativi = == Come stabilire se la CPU supporta la virtualizzazione dell' hardware == Per eseguire '''KVM''' è necessario che il processore supporti la virtualizzazione; Intel e AMD hanno sviluppato estensioni per i loro processori, rispettivamente '''INTEL-VT-x''' (nome in codice Vanderpool) e '''AMD-V''' (nome in codice Pacifica). Per sapere se il processore supporta la virtualizzazione digitare il seguente comando in una finestra di terminale:{{{ egrep -c '(vmx|svm)' /proc/cpuinfo }}} Se la risposta fornita è '''0''' significa che la CPU non supporta la virtualizzazione del hardware. Se la risposta fornita è '''1''' la virtualizzazione è supportata, ma è necessario verificare che nel BIOS sia abilitata l'opzione per la virtualizzazione. == Se possibile usare un kernel a 64 bit == L'esecuzione di un kernel a 64 bit sul sistema ospite è raccomandata ma non indispensabile. Per offrire più di 2047 MB di ram alla macchina virtuale, si deve usare un [[http://wiki.ubuntu-it.org//Architettura64Bit/DomandeFrequenti|kernel a 64 bit]]. Installando un kernel a 32 bit si avrà la limitazione a 2 GB di RAM per macchina. Un sistema a 64 bit può ospitare sia virtualizzazioni a 64 bit che a 32 bit. Mentre un sistema a 32 bit può ospitare solo virtualizzazioni a 32 bit. * Per verificare che il processore sia a 64 bit digitare il seguente comando in una finestra di terminale:{{{ grep ' lm ' /proc/cpuinfo }}} dove «lm» sta per '''long Mode''', per cui la CPU è a 64 bit, se non viene fornita alcuna risposta significa che la CPU non è a 64 bit. * Per verificare che sia in esecuzione un kernel a 64 bit digitare il seguente comando in una finestra di terminale:{{{ uname -m }}} il risultato sarà simile ai seguenti: * '''x86_64''' indica che è in uso un kernel a 64-bit. * '''i386''', '''i486''', '''i586''' o '''i686''', indicano che è in uso un kernel a 32 bit. |
Linea 7: | Linea 57: |
== Come stabilire se la CPU supporta la virtualizzazione del hardware == | Per le seguenti impostazioni, si presume la predisposizione di '''KVM''' su un server, e quindi non ci sarà nessun server X sulla macchina. |
Linea 9: | Linea 59: |
Per eseguire KVM, è necessario che il processore supporti la virtualizzazione; Intel e AMD hanno sviluppato estensioni per i loro processori, rispettivamente INTEL-VT e AMD-V. Per sapere se il processore la supporta eseguire il seguente comando: | [[AmministrazioneSistema/InstallareProgrammi|Installare]] i seguenti pacchetti: |
Linea 11: | Linea 61: |
'''Lucid (10.4) o successive''' | |
Linea 12: | Linea 63: |
egrep '(vmx|svm)' --color=always /proc/cpuinfo |
$ sudo aptitude install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils |
Linea 16: | Linea 66: |
If nothing is printed, it means that your CPU doesn't support hardware virtualisation. Otherwise, it does - but you still need to make sure that virtualisation is enabled in the BIOS. == Use a 64 bit kernel if possible == 1. To serve more than 2047 MB of RAM for your VMs, you '''must''' use a 64 bit kernel (see [[32bit_and_64bit]]). On a 32 bit kernel install, you'll be limited to 2GB RAM at maximum for a given VM. 1. Also, a 64 bit system can host both 32 bit and 64 bit guests. A 32 bit system can only host 32 bit guests. To see if your processor is 64 bit, you can run the following command: {{{ grep ' lm ' /proc/cpuinfo }}} If nothing is printed, it means that your CPU is not 64 bit. ''lm'' stands for Long Mode, so 64 bit CPU. To see if your running kernel is 64 bit, just issue the following command: {{{ uname -m }}} '''x86_64''' indicates a 64-bit kernel running. If you use see i386, i486, i586 or i686, you're running a 32 bit kernel. == Installation of KVM == For the following setup, we will assume that you are deploying KVM on a server, and therefore do not have any X server on the machine. You need to install a few packages first: |
'''Karmic (9.10) o precedenti''' |
Linea 48: | Linea 71: |
* libvirt-bin provides libvirtd which you need to administer qemu and kvm instances using libvirt * kvm is the backend * ubuntu-vm-builder powerful command line tool for building virtual machines * bridge-utils provides a bridge from your network to the virtual machines |
Se si ha la necessità di visualizzare le istanze installare anche il pacchetto: [[apt://virt-viewer | virt-viewer]]. |
Linea 53: | Linea 73: |
You might also want to install ''virt-viewer'', for viewing instances | Descrizione dei pacchetti: |
Linea 55: | Linea 75: |
'''8.10 (intrepid) Notes''': * Two meta packages have been added: {{{ubuntu-virt-server}}} and {{{ubuntu-virt-mgmt}}}. {{{Ubuntu-virt-server}}} installs the packages needed to setup a base virtulization host (kvm, libvirt-bin and openssh-server) and {{{ubuntu-virt-mgmt}}} installs what you need to administer it from a management station (virt-manager, python-vm-builder and virt-viewer). * {{{ubuntu-vm-builder}}} has been replaced by {{{python-vm-builder}}} ([[JeOSVMBuilder|tutorial]]). |
* ''qemu-kvm o kvm'': è il backend. * ''libvirt-bin'': fornisce '''libvirtd''' necessario per amministrare le istanze di '''qemu''' e '''kvm''' usando '''libvirt'''. * ''ubuntu-vm-builder'': potentissimo strumento a riga di comando per la creazione di macchine virtuali. * ''bridge-utils'': fornisce un bridge tra una rete e la macchinea virtuale. === Ubuntu 10.04 === |
Linea 59: | Linea 81: |
'''Note:''' libdevmapper does not load its module when it is installed ([[https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/277648|bug 277648]]) , so you will either need to do a {{{ $ sudo modprobe dm-loop }}} or reboot your system before being able to use it. |
Il pacchetto '''kvm''' è stato sostito da '''qemu-kvm'''. Il pacchetto '''kvm''' è stato etichettato come ''transitional'' di modo che ne sia ancora possibile l'installazione. |
Linea 64: | Linea 83: |
== Adding Users == | === Ubuntu 8.10 e successive === Sono stati aggiunti due metapacchetti: |
Linea 66: | Linea 87: |
'''9.10 Notes''': * The libvirt-bin package will now automatically add members of the ''admin'' group to the ''libvirtd'' group. You still need to log out, and log back in for this change to take effect. |
* [[apt://ubuntu-virt-server | ubuntu-virt-server]]: installa i pacchetti necessari alla configurazione di un host di virtualizzazione basilare ( ''kvm'', ''libvirt-bin'' e ''openssh-server''). * [[apt://ubuntu-virt-mgmt | ubuntu-virt-mgmt]]: installa il necessario per amministrarlo da una stazione gestionale (''virt-manager'', ''python-vm-builder'' e ''virt-viewer''). Mentre ''ubuntu-vm-builder'' è stato sostituito da ''python-vm-builder'' (vedere [[http://help.ubuntu-it.org/9.10/ubuntu/serverguide/it/jeos-and-vmbuilder.html|tutorial]]). |
Linea 69: | Linea 92: |
Add yourself to the ''libvirtd'' group (note that there is no need to add yourself to the ''kvm'' group): {{{ $ sudo adduser `id -un` libvirtd }}} |
|
Linea 74: | Linea 93: |
This will give you access to the system-wide libvirtd instance. This is preferable for you because it gives you access to the advanced networking options rather than simply the "userspace networking" option as you may know it from QEmu. | ||<tablestyle="text-align: justify; width:100%;" style="border:none;" 5%><<Immagine(Icone/Piccole/note.png,,center)>> ||<style="padding:0.5em; border:none;">''Dato che '''libdevmapper''' non carica i suoi moduli durante l'installazione ([[https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/277648|bug 277648]]), è necessario digitare il seguente comando all'interno di una finestra di terminale:{{{$ sudo modprobe dm-loop}}}, oppure riavviare la macchina per poterla utilizzare.''|| |
Linea 76: | Linea 95: |
'''Note: You need to log out and log back in for the new group membership to take effect.''' | |
Linea 78: | Linea 96: |
Note: The `id -un` command will return the current username, for example if your username is ''joe'' you will be effectively be running ''sudo adduser joe libvirtd''. | |
Linea 80: | Linea 97: |
You can test if your install has been successful with the following command: | = Ulteriori risorse = |
Linea 82: | Linea 99: |
{{{ $ virsh -c qemu:///system list Id Name State ---------------------------------- $ }}} If on the other hand you get something like this: {{{ $ virsh -c qemu:///system list libvir: Remote error : Permission denied error: failed to connect to the hypervisor $ }}} Something is wrong and you probably want to fix this before you move on. The critical point here is whether or not you have write access to ''/var/run/libvirt/libvirt-sock''. <<Include(KVM/Header)>> |
* [[https://help.ubuntu.com/community/KVM/Installation|Documento originale]] ---- CategoryVirtualizzazione |
Problemi in questa pagina? Segnalali in questa discussione
Introduzione
In questa pagina verrà spiegato come installare KVM, un programma di virtualizzazione del kernel Linux.
Preparativi
Come stabilire se la CPU supporta la virtualizzazione dell' hardware
Per eseguire KVM è necessario che il processore supporti la virtualizzazione; Intel e AMD hanno sviluppato estensioni per i loro processori, rispettivamente
INTEL-VT-x (nome in codice Vanderpool) e AMD-V (nome in codice Pacifica).
Per sapere se il processore supporta la virtualizzazione digitare il seguente comando in una finestra di terminale:
egrep -c '(vmx|svm)' /proc/cpuinfo
Se la risposta fornita è 0 significa che la CPU non supporta la virtualizzazione del hardware.
Se la risposta fornita è 1 la virtualizzazione è supportata, ma è necessario verificare che nel BIOS sia abilitata l'opzione per la virtualizzazione.
Se possibile usare un kernel a 64 bit
L'esecuzione di un kernel a 64 bit sul sistema ospite è raccomandata ma non indispensabile.
Per offrire più di 2047 MB di ram alla macchina virtuale, si deve usare un kernel a 64 bit. Installando un kernel a 32 bit si avrà la limitazione a 2 GB di RAM per macchina.
Un sistema a 64 bit può ospitare sia virtualizzazioni a 64 bit che a 32 bit. Mentre un sistema a 32 bit può ospitare solo virtualizzazioni a 32 bit.
Per verificare che il processore sia a 64 bit digitare il seguente comando in una finestra di terminale:
grep ' lm ' /proc/cpuinfo
dove «lm» sta per long Mode, per cui la CPU è a 64 bit, se non viene fornita alcuna risposta significa che la CPU non è a 64 bit.
Per verificare che sia in esecuzione un kernel a 64 bit digitare il seguente comando in una finestra di terminale:
uname -m
il risultato sarà simile ai seguenti:x86_64 indica che è in uso un kernel a 64-bit.
i386, i486, i586 o i686, indicano che è in uso un kernel a 32 bit.
Installazione
Per le seguenti impostazioni, si presume la predisposizione di KVM su un server, e quindi non ci sarà nessun server X sulla macchina.
Installare i seguenti pacchetti:
Lucid (10.4) o successive
$ sudo aptitude install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
Karmic (9.10) o precedenti
$ sudo aptitude install kvm libvirt-bin ubuntu-vm-builder bridge-utils
Se si ha la necessità di visualizzare le istanze installare anche il pacchetto: virt-viewer.
Descrizione dei pacchetti:
qemu-kvm o kvm: è il backend.
libvirt-bin: fornisce libvirtd necessario per amministrare le istanze di qemu e kvm usando libvirt.
ubuntu-vm-builder: potentissimo strumento a riga di comando per la creazione di macchine virtuali.
bridge-utils: fornisce un bridge tra una rete e la macchinea virtuale.
Ubuntu 10.04
Il pacchetto kvm è stato sostito da qemu-kvm. Il pacchetto kvm è stato etichettato come transitional di modo che ne sia ancora possibile l'installazione.
Ubuntu 8.10 e successive
Sono stati aggiunti due metapacchetti:
ubuntu-virt-server: installa i pacchetti necessari alla configurazione di un host di virtualizzazione basilare ( kvm, libvirt-bin e openssh-server).
ubuntu-virt-mgmt: installa il necessario per amministrarlo da una stazione gestionale (virt-manager, python-vm-builder e virt-viewer).
Mentre ubuntu-vm-builder è stato sostituito da python-vm-builder (vedere tutorial).
Dato che libdevmapper non carica i suoi moduli durante l'installazione (bug 277648), è necessario digitare il seguente comando all'interno di una finestra di terminale:$ sudo modprobe dm-loop, oppure riavviare la macchina per poterla utilizzare. |