1. Install
Code:Sudo apt-Get install qemu kernel-package Linux-source kqemu-source build-essential
2. At this time, the kqemu source code is already under/usr/src, which is generally kqemu-xxxx. extract the linux-source-2.6.xx.tar.gz 2 in this directory to the current folder. compile the relevant header files of kqemu and execute the following:
Code:
CD/qemu-xxxx
./Configure
Sudo make
Sudo make install
3. Load the kqemu Module
Code:Go to the kqemu directory
Sudo chmod 666/dev/kqemu
4. Create a Windows virtual hard disk
Code:Qemu-IMG create-F qcow windows. IMG 2G
(You can set the size of 2 GB here and use the qcow file format. Therefore, it increases and decreases according to user usage, but the maximum size is 2 GB)
5. Install Windows from the optical drive
Code:Qemu-localtime-CDROM/dev/CDROM-M 384-boot D windows. img
(You can also install it from a hard disk image.
Code:Qemu-localtime-CDROM cdimagefile. iso-M 384-boot D windows. img
Here-M 384 is the specified memory, and 384 Mb is the best XP Minimum Memory.
If the memory is not enough, you can do this.
Code:Sudo umount/dev/SHM
Sudo Mount-T tmpfs-O size = 400 m NONE/dev/SHM
)
* For 64-bit users, use 'qemu-system-x86_64 'instead of 'qemu'; otherwise "-kernel-kqemu" cannot be enabled.
* To install Windows 2000, add the parameter '-win2k-hack '.
6. Use
CTRL + ALT control switch
CTRL + ALT + f full screen switch
7. Save the Configuration
Before starting qemu, you must manually load the kqemu module to write the commands to/etc/rc. Local,
In this way, the system will run these commands
8. Network
See http://fabrice.bellard.free.fr/qemu/qemu-doc.html
9. file sharing between the host and the guest system
Qemu configures a virtual LAN and DHCP server for you.
Configure Samba on the host Ubuntu, and then start qemu.
(Assume that you have a qemu_share folder)
Code:Qemu-SMB $ home/qemu_share-M 384-localtime windows. img
In Windows, you can access shared files.
Net use E: // 10.0.2.2/qemu_share
In addition, the IP address of the host Ubuntu is always 10.0.2.2. Therefore, if you run a server on the host Ubuntu, you can also access it, such
FTP: // 10.0.2.2, and so on.
10. to mount a virtual hard disk, make sure to disable qemu.
Code:Sudo Mount-o loop, offset = 32256 windows. img/mnt
11. Save and restore the status of the VM
After you have installed a virtual machine, you can create a "overlay image" on it ",
Code:Qemu-IMG create-B windows. IMG-F qcow windows. OVL
Now you can run the stack Image
Code:Qemu windows. OVL-enable-audio-user-net-localtime-SMB qemu_share
The stacked image is very small, and only saves the changes made to the original image. If you want to return to the initial status after installation,
Simply delete the overlay image and create a new one.
12. Run the qemu command
When qemu is running, it can also accept the command
Press CTRL + ALT + 2 in the qemu window and you will find the qemu monitor. Enter help to see that you can do a lot of things.
Press CTRL + ALT + 1 to exit
13. convert raw-format virtual hard disk to qcow format
Code:Qemu-IMG convert windows. IMG-O qcow windows. qcow
14. troubleshooting
If your mouse is always in the lower right corner, run the command before starting qemu.
Code:Export sdl_video_x11_dgamouse = 0