Dec 022010
 

qemuHo ricevuto e pubblico molto volentieri questo articolo di Francesco:

Ogni giorno leggiamo di nuove distribuzioni Linux (GNU/Linux per la precisione) e a volte capita di volerle provare “su strada”, anche quelle che non hanno una versione live. Il primo programma che viene in mente, penso, sia proprio Qemu. Ma penso anche che si cerchi subito una alternativa più amichevole. La seconda scelta penso sia Virtualbox, una soluzione basata su Qemu che ti dà subito e senza sforzo tutto quello di cui hai bisogno. Ma è proprio necessario usare un programma che aggiunge altri processi inutili alla nostra macchina Linux? Per quanto mi riguarda no. Ovviamente, affinché mi crediate, il tutto deve essere corredato da una interfaccia grafica “a prova di mouse” e non deve essere usato nessun terminale.

Non ci credete?

Programmi necessari:

  • qemu, il programma principale a linea di comando;
  • qemu-launcher, intefaccia grafica di qemu;
  • qemu-control, add-on di qemu-launcher.




qemu-fig1

(Figura 1 – Qemu-launcher appena avviato.)

A parte il primo tab, quello che ci appare non appena avviamo il programma, è interessante l’ultimo tab “Emulator”:qemu-fig2

(Figura 2)

In figura 2 notiamo che per i nostri scopi l’opzione “Provide a control panel” (che in italiano possiamo tradurre in “Rendi disponibile un pannello di controllo”) deve essere selezionata (segno di spunta) e che in “Additional arguments” dobbiamo aggiungere le opzioni, di qemu, “-enable-kvm -usb”: la seconda opzione “-usb” ci consente di poter utilizzare le porte usb, e quindi eventuali pennette, mentre la prima opzione “-enable-kvm” permette a qemu di poter utilizzare le funzionalità di virtualizzazione del nostro processore, se presente. Con la virtualizzazione abilitata Qemu utilizzerà le risorse del nostro PC in maniera quasi native e in effetti la velocità di esecuzione è molto più veloce rispetto all’uso di Qemu liscio. E’ necessario però che tale funzione sia supportata dal processore, che sia abilitata nel bios della scheda madre e che i relativi driver, i cui nomi dovrebbero iniziare con “kvm”, siano caricati. Per ultimo, controllate che nel tab “Launcher settings” in “Path to ‘qemuctl’” sia indicato dove si trova l’add-on e che esista effettivamente lì.

Avviamo Qemu-launcher attraverso il tasto “Launch”. Appariranno due finestre: la principale dell’emulatore, la più grande, e una piccolina che non è altro che il programma qemu-control.qemu-fig3

(Figura 3)

Avviate dalla finestra principale, che dovrebbe essere titolata QEMU, il sistema operativo che si sta virtualizzando e aspettiamo che termini la fase di avvio. Inseriamo una penna usb e da Qemu-control selezioniamo Connect —> USB —> renew (voce sotto a “connect”) in modo da far riconoscere le periferiche usb esistenti.qemu-fig4(Figura 4)

In Figura 5 vediamo che la nostra pennetta è riconosciuta (voce USB DISK 2.0) e pronta ad essere usata. Dopo averla smontata nel nostro sistema principale, selezioniamo tale voce.qemu-fig5
(Figura 5)

In figura 6 vediamo che il contenuto della pennetta viene mostrato nel sistema virtualizzato e la pennetta è ora completamente a nostra disposizione.qemu-fig6

(Figura 6)

Per rimuovere la pennetta di nuovo “renew”, ma questa volta scegliendo la voce che sta sotto a “disconnect”, e poi in “disconnect” selezioniamo la periferica da disconnettere (figura 7).qemu-fig7

(Figura 7)

Mi sono soffermato solamente all’uso di un mezzo di memorizzazione di massa ma il programma qemu-control permette di fare tante altre cosette interessanti. E’ grazie all’esistenza di questo add-on che ho abbandonato Virtualbox in quanto quest’ultimo richiede per poter utilizzare le periferiche usb una modifica di un file di sistema di Linux, modifica che al momento dell’avvio sfocia in una segnalazione di errore di scarsa importanza ma che comunque dipende dalla presenza di tale software e non da Linux.
Prima di concludere, devo segnalare come il programma principale Qemu-launcher ci consenta di emulare la presenza di schede di rete, scheda audio, scheda video, il tipo di sistema da virtualizzare, la possibilità di memorizzare diversi tipi di settaggi e tante altre cosette che spetterà al lettore scoprire secondo le proprie necessità. E poi parliamo di programmi assolutamente liberi e non semiliberi come Virtualbox, a meno che non scegliate la versione OSE – più limitata, o altri.

Francesco Di Leo

Popular Posts:

Flattr this!

  14 Responses to “Qemu e le sue virtù nascoste.”

  1. AQEMU is alternativer QEMU launcher using QT graphics library. Project hosted in sourceforge.net

  2. Attenzione a cosa pubblicate ragazzi… Virtualbox NON è basato su qemu. Qemu è un software di emulazione Virtualbox invece di virtualizzazione(guardare wikipedia per la conferma). L’equivalente di Virtualbox è il progetto kvm con libvirt e lo trovate nella sua migliore implementazione su fedora 14.
    Buon esperimento

  3. VirtualBox runs so much faster than when I last used Qemu; has Qemu improved in the last few years? I remember when they Free’d their kerlen driver to increase speed, but I think I was using VBox by then.

    I launched Qemu last week to test an installed that wouldn’t launch elsewhere (woo hoo!), but I didn’t pay any attention to its speediness.

    Always great to have more tools in the tool kit; I’ll have to check out these GUIs, especially AQemu as I prefer Qt and KDE apps. Debian Testing has AQemu and Qemu-launcher, but I don’t see Qemu-control…

  4. virt-manager doesn’t support as many qemu options as those UIs, but for most users it’s probably a much better option.

  5. Per essere più precisi, avrei dovuto scrivere che Virtualbox è una soluzione che contiene anche codice di Qemu. In Wikipedia si legge che “In January 2007, VirtualBox was released. It uses some of QEMU’s virtual hardware devices and has a built-in dynamic recompiler that is based on QEMU.”.

    Per quanto riguarda la diatriba tra virtualizzazione ed emulazione confermo che qemu-kvm, versione modificata di Qemu, usa le funzioni di virtualizazione del processore, se presenti ed attivate.

    Francesco Di Leo

  6. Articolo interessante e utile. Grazie.

    Saluti, red/

  7. Salve!

    ottimo articolo! Ho seguito tutto passo passo ma non riesco a far funzionare qemuctl.
    Se abilito la spunta parte solo qemuctl ma non la macchina virtuale. Se faccio partire la macchina virtuale solo successivamente qemuctl da shell ottengo questo errore…

    *** variable not allowed to be undef where GtkTextIter is wanted at /usr/bin/qemuctl line 253.
    *** ignoring at /usr/bin/qemuctl line 286.

    come posso risolvere?

    PS. macchina base ubuntu, macchine virtuali sia windows che altre distro linux.

    • Hai installato il pacchetto qemu-kvm ? Vedo che è un pacchetto disponibile per Ubuntu. Se ottieni altri errori lancia il comando qemu-launcher da terminale e controlla gli eventuali errori.

  8. Hai installato il pacchetto qemu-kvm ? Se ottieni altri errori lancia il comando qemu-launcher da terminale e controlla gli eventuali errori.

  9. Certo. Qemu funziona perfettamente. Riesco a virtualizzare ogni cosa. Ho anche provato ad abilitare le Vt-d.

    Lanciando qemu-launcer ottengo questi warning :

    [CODE]Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    Gtk-WARNING **: GtkSpinButton: setting an adjustment with non-zero page size is deprecated at /usr/bin/qemu-launcher line 2000.
    /usr/bin/qemuctl -boot c -m 4096 -hda ‘/home/fabri/Scrivania/Win7HDD’ -net nic,vlan=0 -net user,vlan=0 -localtime -soundhw sb16[/CODE]

    Flaggando qemuctl e “cliccando su launch” mi si aggiungono queste righe :
    [CODE]
    /usr/bin/qemuctl -boot c -m 4096 -hda ‘/home/fabri/Scrivania/Win7HDD’ -net nic,vlan=0 -net user,vlan=0 -localtime -soundhw sb16 -enable-kvm -usb &
    *** unhandled exception in callback:
    *** variable not allowed to be undef where GtkTextIter is wanted at /usr/bin/qemuctl line 253.
    *** ignoring at /usr/bin/qemuctl line 286.
    [/CODE]
    (che sono gli stessi errori di prima)

    • Mi rimangono due ipotesi: la prima è che qemuctl non esegua o non trovi il giusto eseguibile, quindi fai un controllo del pacchetto qemu-kvm; la seconda è che si tratti di un bug di qemuctl.

Leave a Reply to Linux-lover Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*