Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • Differenze per "Virtualizzazione/Kvm/Installazione"
Differenze tra le versioni 3 e 4
Versione 3 del 21/03/2010 11.27.55
Dimensione: 4690
Autore: FabioMarconi
Commento:
Versione 4 del 21/03/2010 11.41.53
Dimensione: 4750
Commento: come da guida wiki
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 1: Linea 1:
## page was renamed from FabioMarconi/prove6/Installazione

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.

Ove possibile usare un kernel a 64 bit

  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.

  2. 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 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

You might also want to install virt-viewer, for viewing instances

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 (tutorial).

Note: libdevmapper does not load its module when it is installed (bug 277648) , so you will either need to do a

  •  $ sudo modprobe dm-loop 

or reboot your system before being able to use it.

Adding Users

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.

Add yourself to the libvirtd group (note that there is no need to add yourself to the kvm group):

$ sudo adduser `id -un` libvirtd

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.

Note: You need to log out and log back in for the new group membership to take effect.

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.

You can test if your install has been successful with the following command:

$ 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.


CategoryHomepage