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/DomandeFrequenti"
Differenze tra le versioni 2 e 3
Versione 2 del 27/03/2010 16.34.53
Dimensione: 10042
Autore: FabioMarconi
Commento:
Versione 3 del 27/03/2010 17.58.43
Dimensione: 9972
Autore: FabioMarconi
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 64: Linea 64:
  0. vmware2libvirt does not (and cannot) convert anything that was VMware-specific within the guest. See 'Guest Notes' below for more details.

=== Using and Converting VMWar'e virtual Disk Files ===
  0. vmware2libvirt non converte tutto ciò che è specifico di VMWare all'interno dell'ospite.

=== Uso e conversione di file su disco virtuale VMWare ===
Linea 204: Linea 204:
<<Include(KVM/Header)>>

KVM/DomandeFrequenti

Domande frequenti

Prevenzione dei conflitti tra KVM e Virtualbox

Durante l'installazione kvm carica alcuni moduli che impediscono l'esecuzione di altri software per la virtualizazione, come ad esempio virtualbox.

Ovviamente è possibile disabilitare KVM e scaricare i suoi moduli:

1. Assicurarsi di avere completamente spento tutte le macchine virtuali KVM (utilizzando ad esempio virt-manager).

2. Scaricare tutti i suoi moduli:

$ sudo invoke-rc.d kvm stop

In Karmic usare:

$ sudo invoke-rc.d qemu-kvm stop

Avviare una ISO di Dapper, Edgy, Feisty e Gutsy

  • Qui il problema è rapppresentato dal hardware Intel, che limita le estensioni per la virtualizzazione, impedendo così una perfetta interazione con gfxboot. La parte difficile in questa procedura, è la modifica dell'immagine ISO, in modo da disabilitare gfxboot. Le conseguenze posso essere spiacevoli. Siete avvisati!

$ sed -e 's/GFXBOOT bootlogo/#FXBOOT bootlogo/g' < ubuntu-7.10-server-amd64.iso > ubuntu-7.10-server-amd64-nogfxboot.iso

/!\ Non modificare il comando di cui sopra! La lunghezza della stringa non può cambiare, in caso contrario si avrà lo svuotamento del filesystem sul CD.

Un metodo più sicuro è quello di utilizzare gfxboot-disable scaricabile da [http://hg.codemonkey.ws/gfxboot-disable] e quindi eseguire:

$ gfxboot-disable ubuntu-7.10-server-amd64.iso

Avviare una VM in modalità singola

Una VM ha un BIOS completo e può anche eseguire GRUB. La nota dolente sta nel fatto che sparisce dopo alcuni secondi, la maggior parte delle volte non si avrà nemmeno il tempo di eseguire una connessione usando virt-viewer. La soluzione è: spegnere la VM, eseguire virt-viewer con l'argomento --wait ( in questo modo virt-viewer attenderà l'avvio di KVM e popperà immediatamente dopo) quindi avviare la VM; così si avranno circa due secondi per garantire l'accesso al bios o a grub.

Se si sta eseguendo una VM creata con ubuntu-vm-builder, è probabile incontrare un piccolo bug che impedirà l'autenticazione. In questo caso, nel menù di grub selezionare la linea per il ripristino (recovery) e premere e; selezionare la linea che inizia con kernel e premere ancora e. Alla fine della linea aggiungere init=/bin/sh. Confermare con invio e premere b per avviare il kernel con queste impostazioni.

Convertire macchine VMWare a virt-manager

Per gestire la macchina VMWare da virt-manager, il file .vmx deve essere convertito nel file .xmldi libvirt. vmware2libvirt è stata creata per facilitare questo compito. È stata inserita nel pacchetto 'virt-goodies' installabile dai repositories. Una volta installato digitare:

$ vmware2libvirt -f ./file.vmx > file.xml
$ virsh -c qemu:///system define file.xml

Il primo comando converte il 'file.vmx' di VMWare in un 'file.xml' compatibile con libvirt. Vedere  man vmware2libvirt  per maggiori dettagli. Il secondo comando importa il file.xml in libvirt. Il file .xml importato viene memorizzato in /etc/libvirt/qemu.

Minacce

Sebbene vmware2libvirt funzioni bene su macchine virtuali semplici, sussistono limitazioni dovute sia al fatto che i file .wmx non contengono tutte le informazioni necessarie, sia al fatto che vmware2libvirt non analizza a fondo tutte quelle che trova. Alcuni errori possono essere:

  1. Sebbene vmware2libvirt rilevi un ospite a 64-bit,verificare che la corretta architettura sia stata riportata nel suo file .xml:
  • <os>
     <type arch='x86_64' machine='pc'>hvm</type>
     ...
    </os>
    1. vmware2libvirt rileva ed usa solamente la prima interfaccia ethernet interface trovata. ulteriori interfaccie devono essere aggiunte tramite virt-manager.
    2. Attualmente utilizza il primo disco scsi se trovato, altrimenti il primo disco ide. ulteriori dischi possono essere aggiunti tramite virt-manager.
    3. The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:

      <vcpu>2</vcpu>
    4. vmware2libvirt non converte tutto ciò che è specifico di VMWare all'interno dell'ospite.

Uso e conversione di file su disco virtuale VMWare

kvm has the ability to use VMWare's .vmdk disk files directly, as long as the disk is wholly contained in a single vmdk file.

But VMWare also allows splitting a disk into smaller, usually 2 GB, vmdk files. kvm can't use these. You can convert these files into a single virtual disk file using vmware-vdiskmanager. It is e.g. included in VMWare Server (freely available).

$ vmware-vdiskmanager -r <Name of splitted vmdk base file> -t 0 <Name of new single vmdk file>

Modify the virtual machines xml file in /etc/libvirt/qemu:

 ...
 <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/diskname.vmdk'/>
      <target dev='hda' bus='ide'/>
 </disk>
 ...

and redefine it:

$ virsh -c qemu:///system define NameOfMachine.xml

IMPORTANT: keep in mind that while the .vmx file is converted to .xml, the disks are used as is. Please make backups, especially if you want to use the virtual machine in VMWare later.

kvm is not able to make snapshots when using vmdk disk files. So I recommend to convert the virtual disk file in qemu's format qcow2. Package qemu contains a utility qemu-img to do this:

qemu-img convert diskname.vmdk -O qcow2 diskname.qcow2

change the machines xml file and redefine it (see above).

Should VMWare Tools be kept after conversion?

If converting from vmware to libvirt, be sure to remove vmware-tools if you have it installed (otherwise it will overwrite xorg.conf on reboot)

How to convert physical Machines to virt-manager

If you want to convert a Windows (XP) physical machine you first may have to enable IDE in the registry. Start the machine and execute mergeide.reg. See Microsoft KB Article 314082.

using VMWare Converter

VMWare Converter is a free tool to migrate a physical machine to VMWare. So the first step is to migrate the physical machine to a VMware image. The second step is to follow the howto "How to convert VMWare Machines to virt-manager" (see above).

using linux tools

See the german book about qemu physical to virtual. There is a link to translate it in english.

Should ntp be used for time synchronisation?

Guests should not use ntp to synchronize the clock, so be sure to remove/disable ntpd

Which driver should be used for Xorg?

Video

Linux guests with Xorg should be using the 'cirrus' video driver. To use, adjust /etc/X11/xorg.conf to have:

Section "Device"
        Identifier      "Configured Video Device"
        Driver          "cirrus"
EndSection

then be sure that your Screen section uses 'Configured Video Device' for its Device.

Mouse

Linux guests with Xorg should be using the 'vmmouse' driver (not available on Ubuntu Dapper). To use, perform within the guest:

aptitude install xserver-xorg-input-vmmouse

then adjust /etc/X11/xorg.conf to have (the Identifier line should not change, and you should have only an Identifier line and Driver line for the mouse):

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "vmmouse"
EndSection

How to set up guest resolution in Xorg ?

Linux guests with Xorg need to adjust the resolution for Xorg in /etc/X11/xorg.conf. Look for the Screen section, and make sure each of the 'Modes' lines has a reasonable resolution for your system (due to bug #193456 the resolution in the guest's resolution needs to be smaller than the host). Eg:

Section "Screen"
        ...
        SubSection "Display"
                Depth           16
                Modes           "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           24
                Modes           "800x600" "640x480"
        EndSubSection
EndSection

What system specific adjustments are recommended?

Windows (<Vista)

Windows (other than Vista) virtual machines should substitute in the .xml file:

<features>
  <acpi/>
</features>

with:

<features/>

Windows Vista

Windows Vista virtual machines should add this to the xml file:

<domain type='kvm'>
...
  <features>
    <acpi/>
  </features>
</domain>

Debian Sarge

Debian Sarge (oldstable) may write /boot/grub/menu.lst incorrectly, resulting in the following on boot:

pivot_root: no such file or directory
/sbin/init: 432: cannot open dev/console: no such file
Kernel panic: Attempted to kill init!

The fix is at the grub menu, press 'e' and adjust root=/dev/hdb1 to be root=/dev/hda1. After a successful boot, you will need to update /boot/grub/menu.lst to have:

# kopt=root=/dev/hda1 ro

and run:

# update-grub

OpenBSD 4.1 (and others?)

OpenBSD 4.1 (and probably others) when using the rtl8139 network driver may realize poor network performance and see this message on the console:

re0: watchdog timeout

The fix is to use another NIC (e1000 appears to work well). See 'Changing the Network Card Model' above.

OpenBSD 4.5 and later

A change in the OpenBSD kernel causes it to hang on boot at "setting tty flags". If this affects you, follow the instructions on http://scie.nti.st/2009/10/4/running-openbsd-4-5-in-kvm-on-ubuntu-linux-9-04



CategoryHomepage CategoryInTraduzione