Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
slackware:qemu [2006/04/12 09:41] – alien | slackware:qemu [2007/11/16 09:10] – Conform to current udev syntax: change KERNEL="kqemu" to KERNEL=="kqemu" alien | ||
---|---|---|---|
Line 49: | Line 49: | ||
You should realize that running an operating system directly on the hardware is always faster than running the same operating system inside a virtual machine, because of the processor overhead that the virtualization of all hardware dictates. Even so, the guest operating system inside the QEMU virtual machine feels suprisingly responsive if you have a decent CPU and lots of RAM. | You should realize that running an operating system directly on the hardware is always faster than running the same operating system inside a virtual machine, because of the processor overhead that the virtualization of all hardware dictates. Even so, the guest operating system inside the QEMU virtual machine feels suprisingly responsive if you have a decent CPU and lots of RAM. | ||
- | + | ==== Obtaining | |
- | ==== Obtaining QEMU software | + | |
Qemu is not part of Slackware, but it is easily built from source, and [[http:// | Qemu is not part of Slackware, but it is easily built from source, and [[http:// | ||
+ | |||
+ | //NOTE// Building qemu and kqemu has changed with qemu 0.8.1.\\ | ||
+ | Until qemu 0.8.0, if you want to use kqemu you need to | ||
+ | - unpack the qemu source archive | ||
+ | - change into the ' | ||
+ | - unpack the kqemu archive in this subdirectory | ||
+ | - move up one directory level to the top of the qemu source tree and run the < | ||
+ | ./configure | ||
+ | make | ||
+ | make install</ | ||
+ | - download and unpack qemu sources | ||
+ | - configure and build qemu with kqemu support (this is the default if you run '' | ||
+ | - install qemu on your computer using '' | ||
+ | - download, unpack kqemu archive | ||
+ | - configure and build kqemu, and install it on your computer using '' | ||
Line 85: | Line 99: | ||
</ | </ | ||
# kqemu | # kqemu | ||
- | KERNEL=" | + | KERNEL==" |
# kqemu | # kqemu | ||
- | KERNEL=" | + | KERNEL==" |
+ | </ | ||
* To make the kqemu module load on boot, you should add the following line to the file ''/ | * To make the kqemu module load on boot, you should add the following line to the file ''/ | ||
Line 137: | Line 152: | ||
By default, QEMU uses a feature which is called //user-mode network//. QEMU will run an internal DHCP server that can assign an IP address to the virtual computer in case that is configured to use DHCP. The network range and gateway are hard-coded into QEMU but it allows your virtual machine to call out to your host machine and beyond. For user-mode networking, you don't need to configure anything on your host. I will probably document user-mode networking sometime later, but for now I suggest you read [[slackware: | By default, QEMU uses a feature which is called //user-mode network//. QEMU will run an internal DHCP server that can assign an IP address to the virtual computer in case that is configured to use DHCP. The network range and gateway are hard-coded into QEMU but it allows your virtual machine to call out to your host machine and beyond. For user-mode networking, you don't need to configure anything on your host. I will probably document user-mode networking sometime later, but for now I suggest you read [[slackware: | ||
- | |||
==== Advanced topics ==== | ==== Advanced topics ==== | ||
Line 235: | Line 249: | ||
ln -s lp0 parport0 | ln -s lp0 parport0 | ||
</ | </ | ||
+ | |||
+ | |||
+ | === Printing to the Host's CUPS server === | ||
+ | |||
+ | The Guest OS can print to a CUPS printer that you configured on the Host. No other software on the Host or the Guest is needed. The Guest' | ||
+ | |||
+ | If your Guest is Windows 2000/XP, you need to do the following: | ||
+ | - Click on "add printer" | ||
+ | - Select " | ||
+ | - Pick " | ||
+ | - Install the driver for your printer (you will need to have the driver setup program ready if it is not supported by Windows by default);\\ \\ The URL for your CUPS printer will look like < | ||
+ | http:// | ||
+ | |||
+ | If your Guest is Slackware Linux, then you need to setup the CUPS client in the Guest. I assume that you already installed the CUPS package when you installed Linux in the Guest. This is what you should do: | ||
+ | - Edit the file ''/ | ||
+ | - Make the CUPS init script executable so that CUPS will start automatically when the Guest boots: < | ||
+ | - Reboot the Guest or (re-) start CUPS: < | ||
+ | - Your Guest should now be able to use your Host CUPS printer. | ||
+ | |||
+ | <note tip> | ||
+ | In case you configured your Host's CUPS server to make it visible to other CUPS clients on your network (read my [[slackware: | ||
+ | </ | ||
=== Sound support in the Guest === | === Sound support in the Guest === | ||
- | QEMU has pretty good sound support. It emulates several sound hardcards. You can print a list of the emulated cards by running < | + | QEMU has pretty good sound support. It emulates several sound hardcards. You can print a list of the emulated cards by running < |
- | For sound output, QEMU uses SDL which in turn uses OSS. Slackware uses the ALSA sound driver which has OSS emulation support. The scripts in the final section of this Wiki page show you how to setup your environment so that you can actually hear the sound that QEMU outputs. Since version 0.8.0, QEMU can use ALSA directly for sound output, but you will have to explicitly enable this when building the sofware. Add < | + | For sound output, QEMU uses SDL which in turn uses OSS. Slackware uses the ALSA sound driver which has OSS emulation support. Since version 0.8.0, QEMU can use ALSA directly for sound output, but you will have to explicitly enable this when building the sofware. Add < |
+ | The scripts in the final section of this Wiki page show you how to setup your environment so that you can actually hear the sound that QEMU outputs. The requirement for sound to come from your speakers is the environment variable '' | ||
+ | '' | ||
=== Using an USB device in QEMU === | === Using an USB device in QEMU === | ||
- | FIXME | + | USB devices that are connected to the host machine can be accessed directly inside the Virtual Machine. QEMU needs an aditional parameter '' |
+ | qemu -usb -usbdevice host:< | ||
+ | </ | ||
+ | qemu -usb < | ||
+ | </ | ||
+ | usb_add host:< | ||
+ | </ | ||
+ | * An example: You have a HP Scanjet 3300C connected to the USB port of your computer. The output of '' | ||
+ | # lsusb | ||
+ | Bus 003 Device 002: ID 03f0:0205 ScanJet 3300C | ||
+ | </ | ||
+ | qemu -usb -usbdevice host: | ||
- | === Copy/paste text between | + | <note important> |
+ | The important thing to consider with using real USB devices, is that the Host must not have any driver loaded for the USB device. If your hotplug loads drivers automatically, | ||
+ | </ | ||
- | FIXME | + | === PXE booting your QEMU virtual machine === |
+ | In [[: | ||
+ | Yet there are times when you'd want your QEMU virtual machine were able to use PXE to boot from the network, if only to test your network setup without sacrificing real hardware. There is only one problem, the emulated QEMU network card (Realtek 8029, a NE2000 clone) does not support booting from the network (it does not emulate a boot ROM). | ||
- | === Sharing files between Host and Guest === | + | There are two ways to overcome this problem. |
+ | |||
+ | * The first is to use the [[http:// | ||
+ | * Select //latest production release// | ||
+ | * Choose NIC/ROM type **ns8390: | ||
+ | * Choose ROM output format **ISO bootable image without legacy floppy emulation (.iso)** | ||
+ | * To generate and download a ROM image press: < | ||
+ | * Save the generated ISO file on your local hard disk (for instance as // | ||
+ | qemu -cdrom qemu_pxeboot.iso -boot d <other options> | ||
+ | </ | ||
+ | |||
+ | * The other option you have is available since QEMU 0.9.0 and that is to use the //'' | ||
+ | * / | ||
+ | * / | ||
+ | * / | ||
+ | qemu -localtime -m 256 -hda slackware.img -boot n -option-rom / | ||
+ | |||
+ | |||
+ | <note tip> | ||
+ | If you read the [[slackware: | ||
+ | DNSMASQ_OPTIONS=" | ||
+ | * QEMU sees your //host// as having the IP Address '' | ||
+ | * Your //host// has a TFTP server setup so that ''/ | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | If your TFTP server is not installed on the //host// but somewhere on the " | ||
+ | Actually, there is no problem if you are using VDE for the network support. The '' | ||
+ | We need a some extra work on the iptables firewall here, to let the TFTP traffic pass along. Add the following commands to the '' | ||
+ | modprobe ipt_state | ||
+ | modprobe ipt_helper | ||
+ | modprobe ip_conntrack_tftp | ||
+ | modprobe ip_nat_tftp | ||
+ | iptables -A INPUT -m helper --helper tftp -j ACCEPT | ||
+ | iptables -A OUTPUT -m helper --helper tftp -j ACCEPT | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Copy/paste text between Host and Guest === | ||
FIXME | FIXME | ||
- | === The VNC patch and other user contributions | + | === Sharing files between Host and Guest === |
FIXME | FIXME | ||
+ | |||
+ | '' | ||
==== A QEMU start script ==== | ==== A QEMU start script ==== | ||
Line 335: | Line 429: | ||
* __IRC__: the #qemu channel on Freenode. | * __IRC__: the #qemu channel on Freenode. | ||
- |