Dimensione: 4498
Commento:
|
Dimensione: 5113
Commento:
|
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 FabioMarconi/Prove6 ##title KVM Installation [[BR]] [[Indice(depth=2 align=right)]] = Introduzione = In questa pagina verrà spiegato come installare '''KVM''', un programma di virtualizzazione del kernel Linux. |
Linea 9: | Linea 15: |
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: | 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: |
Linea 16: | Linea 22: |
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. | Se non viene fornita alcuna risposta significa che la CPU non supporta la virtualizzazione del hardware. In caso contrario è supportata, ma è necessario verificare che nel BIOS sia abilitata l'opzione per la virtualizzazione. |
Linea 18: | Linea 24: |
== Use a 64 bit kernel if possible == | == Se possibile usare un kernel a 64 bit == |
Linea 20: | Linea 26: |
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. |
1. Per offrire più di 2047 MB di ram alla VMs, '''si deve''' usare un kernel a 64 bit (vedere***********link pag hardware32 e 64 bit). Installando un kernel a 32 bit si avrà la limitazione a 2 GB di RAM per VM. 1. 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. |
Linea 23: | Linea 29: |
To see if your processor is 64 bit, you can run the following command: | Per verificare che il processore sia a 64 bit, eseguire il seguente comando: |
Linea 28: | Linea 34: |
If nothing is printed, it means that your CPU is not 64 bit. ''lm'' stands for Long Mode, so 64 bit CPU. | Se non viene fornita alcuna risposta significa che la CPU non è a 64 bit. ''lm'' significa long Mode, per cui la CPU è a 64 bit. |
Linea 30: | Linea 36: |
To see if your running kernel is 64 bit, just issue the following command: | Per verificare che sia in esecuzione un kernel a 64 bit, eseguire il seguente comando: |
Linea 35: | Linea 41: |
'''x86_64''' indicates a 64-bit kernel running. If you use see i386, i486, i586 or i686, you're running a 32 bit kernel. | '''x86_64''' indica che è in uso un kernel a 64-bit. Invece i386, i486, i586 or i686, indicano che è in uso un kernel a 32 bit. |
Linea 38: | Linea 44: |
== Installation of KVM == | == Installazione di KVM == |
Linea 40: | Linea 46: |
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. | Per le seguenti impostazioni, si presume la predisposizione di KVM su un server, e quindi non ci sarà nessun server X sulla macchina. |
Linea 42: | Linea 48: |
You need to install a few packages first: | Innanzitutto installare i seguenti pacchetti: |
Linea 48: | Linea 54: |
* 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 |
* libvirt-bin fornisce libvirtd necessario per amministrare le istanze di qemu e kvm usando libvirt. * kvm è il backend. * 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. |
Linea 53: | Linea 59: |
You might also want to install ''virt-viewer'', for viewing instances | Nella necessità di visualizzare le istanze installare anche ''virt-viewer''.You might also want to install ''virt-viewer'', for viewing instances |
Linea 55: | Linea 61: |
'''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]]). |
'''Note riguardo 8.10 (Intrepid)''': * Sono stati aggiunti due metapacchetti: ''ubuntu-virt-server'' e ''ubuntu-virt-mgmt''. ''Ubuntu-virt-server'' installa i pacchetti necessari alla configurazione di un host di virtualizzazione basilare (kvm, libvirt-bin e openssh-server) e ''ubuntu-virt-mgmt'' installa il necessario per amministrarlo da una stazione gestionale (virt-manager, python-vm-builder e virt-viewer). * ''ubuntu-vm-builder'' è stato sostituito da ''python-vm-builder'' ([https://help.ubuntu.com/community/JeOSVMBuilder tutorial]). |
Linea 60: | Linea 66: |
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. |
Dato che libdevmapper non carica i suoi moduli durante l'installazione ([https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/277648 bug 277648]), è necessario eseguire il comando: {{{ $ sudo modprobe dm-loop }}} oppure riavviare la macchina per poterla utilizzare.. |
Linea 64: | Linea 72: |
== Adding Users == | == Aggiungere utenti == |
Linea 66: | Linea 74: |
'''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. |
'''Note riguardo 9.10 (Karmic)''': * Il pacchetto libvirt-bin aggiunge automaticamente i membri del gruppo ''admin'' al gruppo ''libvirtd''. Rimane comunque necessario eseguire il log out, e quindi autenticarsi nuovamente per rendere effettivi questi cambiamenti. |
Linea 69: | Linea 77: |
Add yourself to the ''libvirtd'' group (note that there is no need to add yourself to the ''kvm'' group): | Per aggiungersi al gruppo ''libvirtd'' (nota: non è necessario aggiungersi anche al gruppo ''kvm'') eseguire il comando: |
Linea 74: | Linea 82: |
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. | Ciò consente l'accesso a livello di sistema all'istanza libvirtd. In questo modo è possibile accedere ad opzioni di networking avanzate piuttosto che alle semplici opzioni "userspace networking" utilizzate su QEmu. |
Linea 76: | Linea 84: |
'''Note: You need to log out and log back in for the new group membership to take effect.''' | '''Importante: È necessario eseguire il log out e riautenticarsi perchè le nuove aggiunte al gruppo siano effettive.''' |
Linea 78: | Linea 86: |
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''. | Nota: Il comando `id -un` restituisce il nome dell'attuale utente, per esempio se l'attuale utente è ''joe'' sarà effettivamente eseguito ''sudo adduser joe libvirtd''. |
Linea 80: | Linea 88: |
You can test if your install has been successful with the following command: | È possibile verificare la correttezza dell'installazione con il comando: |
Linea 90: | Linea 98: |
If on the other hand you get something like this: | Se l'installazione non è avvenuta correttamente allora avremo un messaggio simile a: |
Linea 98: | Linea 106: |
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''. | Qualcosa è sbagliato e deve essere riparato prima di proseguire. Qui il punto critico è avere i permessi di scrittura al file ''/var/run/libvirt/libvirt-sock''. |
Linea 100: | Linea 108: |
<<Include(KVM/Header)>> | = Ulteriori risorse = * [https://help.ubuntu.com/community/KVM/Installation Documento originale] ---- CategoryHomepage |
BR Indice(depth=2 align=right)
Introduzione
In questa pagina verrà spiegato come installare KVM, un programma di virtualizzazione del kernel Linux.
Installazione
Come stabilire se la CPU supporta la virtualizzazione del hardware
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:
egrep '(vmx|svm)' --color=always /proc/cpuinfo
Se non viene fornita alcuna risposta significa che la CPU non supporta la virtualizzazione del hardware. In caso contrario è supportata, ma è necessario verificare che nel BIOS sia abilitata l'opzione per la virtualizzazione.
Se possibile usare un kernel a 64 bit
Per offrire più di 2047 MB di ram alla VMs, si deve usare un kernel a 64 bit (vedere***********link pag hardware32 e 64 bit). Installando un kernel a 32 bit si avrà la limitazione a 2 GB di RAM per VM.
- 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, eseguire il seguente comando:
grep ' lm ' /proc/cpuinfo
Se non viene fornita alcuna risposta significa che la CPU non è a 64 bit. lm significa long Mode, per cui la CPU è a 64 bit.
Per verificare che sia in esecuzione un kernel a 64 bit, eseguire il seguente comando:
uname -m
x86_64 indica che è in uso un kernel a 64-bit. Invece i386, i486, i586 or i686, indicano che è in uso un kernel a 32 bit.
Installazione di KVM
Per le seguenti impostazioni, si presume la predisposizione di KVM su un server, e quindi non ci sarà nessun server X sulla macchina.
Innanzitutto installare i seguenti pacchetti:
$ sudo aptitude install kvm libvirt-bin ubuntu-vm-builder bridge-utils
- libvirt-bin fornisce libvirtd necessario per amministrare le istanze di qemu e kvm usando libvirt.
- kvm è il backend.
- 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.
Nella necessità di visualizzare le istanze installare anche virt-viewer.You might also want to install virt-viewer, for viewing instances
Note riguardo 8.10 (Intrepid):
Sono stati aggiunti due metapacchetti: ubuntu-virt-server e ubuntu-virt-mgmt. Ubuntu-virt-server installa i pacchetti necessari alla configurazione di un host di virtualizzazione basilare (kvm, libvirt-bin e openssh-server) e ubuntu-virt-mgmt installa il necessario per amministrarlo da una stazione gestionale (virt-manager, python-vm-builder e virt-viewer).
ubuntu-vm-builder è stato sostituito da python-vm-builder ([https://help.ubuntu.com/community/JeOSVMBuilder tutorial]).
Note:
Dato che libdevmapper non carica i suoi moduli durante l'installazione ([https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/277648 bug 277648]), è necessario eseguire il comando:
$ sudo modprobe dm-loop
oppure riavviare la macchina per poterla utilizzare..
Aggiungere utenti
Note riguardo 9.10 (Karmic):
Il pacchetto libvirt-bin aggiunge automaticamente i membri del gruppo admin al gruppo libvirtd. Rimane comunque necessario eseguire il log out, e quindi autenticarsi nuovamente per rendere effettivi questi cambiamenti.
Per aggiungersi al gruppo libvirtd (nota: non è necessario aggiungersi anche al gruppo kvm) eseguire il comando:
$ sudo adduser `id -un` libvirtd
Ciò consente l'accesso a livello di sistema all'istanza libvirtd. In questo modo è possibile accedere ad opzioni di networking avanzate piuttosto che alle semplici opzioni "userspace networking" utilizzate su QEmu.
Importante: È necessario eseguire il log out e riautenticarsi perchè le nuove aggiunte al gruppo siano effettive.
Nota: Il comando id -un restituisce il nome dell'attuale utente, per esempio se l'attuale utente è joe sarà effettivamente eseguito sudo adduser joe libvirtd.
È possibile verificare la correttezza dell'installazione con il comando:
$ virsh -c qemu:///system list Id Name State ---------------------------------- $
Se l'installazione non è avvenuta correttamente allora avremo un messaggio simile a:
$ virsh -c qemu:///system list libvir: Remote error : Permission denied error: failed to connect to the hypervisor $
Qualcosa è sbagliato e deve essere riparato prima di proseguire. Qui il punto critico è avere i permessi di scrittura al file /var/run/libvirt/libvirt-sock.
Ulteriori risorse
[https://help.ubuntu.com/community/KVM/Installation Documento originale]