QEMU

Iz projekta Ubuntu-RS Wiki
Idi na: navigacija, pretraga
Ovaj članak treba ažurirati!!! Ovaj članak ili jedan njegov deo nije ažuriran.
Ovaj članak treba da bude ažuriran. Ažurirajte ovaj članak, kako bi sadržao najnovije dostupne informacije i uklonite ovaj šablon kada završite. Molimo pogledajte stranicu za razgovor za više informacija. Uredi ga i ažuriraj ga.



Sadržaj

Pokretanje virtuelne mašine pod Ubuntuom 7.04

QEmu vam omogućava da pokrenete OS unutar drugog OS-a - na primer, Windows pod Linuxom. QEmu koristi kqemu, acceleration drajver iz Ubuntu 7.04 Feisty Fawn-a da bi pokrenuo Windows na pristojnoj brzini.

Ubuntu 7.04 Feisty Fawn takođe ima i novu verziju rdesktop-a koja može da se koristi za pokretanje individualnih aplikacija iz VM ali na vašem desktopu. Link: SeamlessVirtualization.

https://help.ubuntu.com/community/WindowsXPUnderQemuHowTo?action=AttachFile&do=get&target=SeamlessVirtualizationWithThemingResized.png

Napomena: Većina računara kupljenih 2006 i noviji imaju podršku za Intel-VT ili AMD Pacifica (AMD-V), tehnologije koje omogućavanju hardversku podršku virtuelizaciji. Da biste proverili da li vaš sistem ima ove tehnologije pokrenite sledeću naredbu u konzoli:

grep -E '^flags.*(vmx|svm)' /proc/cpuinfo

Ako dobijete neki rezultat preporučujemo vam korišćenje Kernel Virtuelizacije.

Napomena: Čak i ako ne dobijete rezultat ove komande vaš računar možda ima hardversku podršku virtuelizaciji. Neki računari se isporučuju sa isključenom opcijom hardverske virtuelizacije u BIOS-u dok druge mašine je koriste samo ako je BIOS ažuriran na najnoviju verziju.

Instalacija OS-a u QEmu sa Ubuntu Feisty 7.04

Iako ovaj vodič opisuje instalaciju Windows XP-a, bilo kog Linuxa ili BSD-a. Ranije verzije Windows-a rade fino, i možda su i preporučljivije s obzirom na brzinu kojom se izvršavaju.

1. Prvo treba da instalirate qemu kqemu-source, kqemu-common i module assistant iz Universe riznice.

sudo apt-get install qemu kqemu-source module-assistant kqemu-common

2. Sledi pravljenje kqemu modula

sudo module-assistant prepare
sudo module-assistant auto-install kqemu


3. Zatim treba podesiti udev da pravi /dev/kqemu device node nakon učitavanja kqemu modula

gksu gedit /etc/udev/rules.d/60-kqemu.rules  

sa sledećim sadržajem: (redosled GROUP i MODE je izgleda bitan i obavezno napravite novi red na kraju fajla)

KERNEL=="kqemu", NAME="%k", GROUP="kqemu", MODE="0660"  

4. Promenite sadržaj /etc/modprobe.d/kqemu u

options kqemu major=0

5. Napravite korisničku grupu "kqemu" i dodelite joj korisnike kojima će biti dozvoljeno korišćenje QEMU-a sa akceleratorom

sudo addgroup --system kqemu
sudo adduser $USER kqemu 

6. Učitaćemo kqemu modul

sudo modprobe kqemu

7. Proverite da li su dozvole kako treba

$ ls -l /dev/kqemu
crw-rw---- 1 root kqemu 10, 62 2007-07-22 15:36 /dev/kqemu
sudo modprobe -r kqemu
sudo modprobe kqemu

Ako i dalje imate isti problem dodajte OWNER="vašekorisničkoime" na kraju udev rule-a i probajte ponovo

8. Ako vam je potrebno da kqemu bude učitan pri svakom podizanju sistema, dodajte novi red sa kqemu u /etc/modules datoteku

gksu gedit /etc/modules 

9. Napravićemo virtuelni hard disk od 2 Gb za OS virtuelne mašine

qemu-img create -f qcow test.img 2G

10. Instalirajte OS na virtuelnu mašinu. Stavite CD u uređaj i pokrenite:

qemu -localtime -cdrom /dev/cdrom -m 384 -boot d test.img

11. Ovako ćete pokrenuti QEmu sa časovnikom iz Ubuntu-a, test.img će predstavljati hard disk, /dev/cdrom predstavlja instalacioni CD, 384 MB sistemske memorije i podizanje sistema će biti sa CD-a.

12. Alternativno, možete koristiti .iso slike

qemu -localtime -cdrom InstalacioniCD.iso -m 384 -boot d test.img

13. If you're having trouble creating the Windows partition during Windows installation, check that you have read and write access to the disk image. Use this command to set the file permissions for the windows.img file so that all users in the kqemu group can access the virtual disk

chmod 660 test.img
sudo chown $USER:kqemu test.img


14. QEmu will start, boot from the CD, and load the XP installer. The installer works like any other Windows install for the most part. However, on some systems the last part of the initial install, pictured, below, will stick around for a very long time. In this case, just reboot (restart QEmu), and the installer will proceed past this point.

https://help.ubuntu.com/community/WindowsXPUnderQemuHowTo?action=AttachFile&do=get&target=windows%2Bxp%2Bin%2Bqemu.png

15. After a few 'reboots' of QEmu you will be running Windows XP.

16. Clicking on the QEmu window will take control of the Windows cursor. To go back to Linux, press Ctrl + Alt and to toggle fullscreen press Ctrl + Alt + F

Mreža

QEmu provides two modes of networking. In both modes, a virtual network adapter is created inside Windows XP guest.

User mode mreža

In user mode networking, QEmu manages network interface internally in the user mode emulator application. QEmu provides DHCP host which assigns a dynamic IP for the guest OS. TCP and UDP ports can be redirected from the host OS to the guest OS using QEmu command line parameters.


        QEMU VLAN      <------>  Firewall/DHCP server <-----> Host network
                          |          (10.0.2.2)
                          |
                          ---->  DNS server (10.0.2.3)
                          |     
                          ---->  SMB server (10.0.2.4)



Pros

Cons

TAP mreža

In TAP networking, QEmu connects the guest OS ethernet to the host OS using TAP network bridge. Linux creates a virtual network interface (tap0) which appears in ifconfig listing as other network interfaces. Further, it is possible to bridge network traffic to the guest OS using normal Linux network bridging functionalities.

For examples, see following pages

Pros

Cons

Dodatne opcije

Deljenje datoteka sa Windows XP-om

It's not much use having an XP installation if you can't transfer files between Ubuntu and XP. Fortunately, QEMU sets up a virtual LAN and DHCP server for you. You can transfer files to and from XP just as if it was on a real LAN. You can also browse the net and download files and do all the network stuff you would do on a real networked XP box.

Deljenje datoteka između Domaćina i VM-e

QEmu supports file sharing between the VM and host if you have [:SettingUpSamba:Samba configured on the host system]. The following assumes you have a share called 'qemu_share' in your home directory intended to transfer files between Ubuntu and Windows.

To set this up, start QEmu with the following command:

qemu -smb $HOME/qemu_share -m 384 -localtime windows.img


Inside Windows, you can access the shared drive with the following command from a DOS prompt. For example, to map Windows drive 'e' to the share

net use e: \\10.0.2.2\qemu_share


The IP address of Ubuntu will always be 10.0.2.2. If you have running servers on your Ubuntu box, they can also be accessed at this IP address (e.g. ftp:\\10.0.2.2)

Priključenje virtuelnog diska

You can also mount the QEmu virtual disk just like any other drive. QCOW images cannot be mounted. If the drive was created in qcow format you'll need to convert it first, see [#convertimg2raw below].

Make sure you are NOT running QEMU when you do this.

To mount the drive, create a directory '/media/qemu'. Then run

sudo mount -o loop,offset=32256 test.img /media/qemu


Snimanje i kasnije pozivanje stanja VM-e

You can quickly save and restore the state of your Windows System using QEmu's 'overlay images'. Once you have done your initial install, you can create an overlay image and run QEMU off this. The overlay image is very much smaller that the original image and will only contain changes made since the original install. If you trash your XP installation, you can simply delete the overlay image and create a new one from the original image.

To create an overlay image, use the qemu-image program. To create an image test.ovl from test.img, issue the following

qemu-img create -b test.img -f qcow test.ovl


To run Windows, you would now use

qemu test.ovl -enable-audio -user-net -localtime -smb qemu_share


If the test.ovl installation is ruined, you can delete it, and start QEmu using the test.img file. But you will lose changes made since the original install.

QEmu also accepts commands from the shell while it is running. To do this, though, you need to press CTRL+ALT+2 with the QEmu window active. This brings up the QEmu Monitor. From here, you can swap CDs, send keypresses to the emulator, suspend to disk and so on. See the official documentation for full details. To exit the QEmu monitor press CTRL+ALT+1


Converting a qcow image to a raw file

To convert a qcow image, 'test.img', to a raw 'test.raw' file , run

qemu-img convert test.img -O raw test.raw


Konverzija raw virtuelnog disk u qcow format

To convert a raw 'test.img' file to a qcow formatted 'test.qcow', run

qemu-img convert test.img -O qcow test.qcow


Problemi

If you experience problems with mouse pointer hanging in bottom right corner, try before you start up qemu

export SDL_VIDEO_X11_DGAMOUSE=0

Spoljni linkovi


Korisnička dokumentacija
Aplikacije | Multimedija | Internet i mreže | Virtuelizacija | Saveti i trikovi | Eyecandy | Serveri | Instalacija | Hardver | Laptop | Sigurnost | Igre | Info
Lični alati
Imenski prostori
Varijante
Akcije
Navigacija
alati
Linkovi