Bochs and Qemu

Bochs and Qemu are two different x86 emulators. They are similar to vmware, in that they let you boot a virtual computer from inside your normal operating system. For example, I hit the power button on my computer and boot into Ubuntu Linux. I log into X Windows normally and then run Bochs and pass in a disk image and it opens a fancy little window containing Fedora Core 1.

They’re both pretty good. I like Qemu better. It seems a lot faster. And I like that everything is passed in on the command line rather than requiring a config file for each image.

Steps to use Bochs on Ubuntu:

1. Edit /etc/apt/sources.list and uncomment the Universe apt repositories
2. sudo apt-get install bochs bximage
3. mkdir ~/BochsImages
4. mkdir ~/BochsImages/FedoraCore1
5. cd ~/BochsImages/FedoraCore1
6. cp /usr/share/doc/bochs/examples/bochsrc.gz bochsrc.gz
7. gunzip bochsrc.gz
8. Edit bochsrc
1. a. Change the “megs” setting to 512
2. b. Comment out the two floopy drives
3. c. Change boot paramater in ~/.bochsrc to boot from hard disk?
9. bximage
1. a. hd
2. b. flat
3. c. 32255
4. d. FedoraCore4.img
10. bochs
11. If your Fedora Core 1 CD is in the CD-ROM drive then bochs will boot the image and boot from the CD, then you can do the normal install routine. Afterward, change your bochsrc to not boot from the CD-ROM drive. I did a “linux text” install.

Steps to use Qemu on Ubuntu:

1. Edit /etc/apt/sources.list and uncomment the Universe apt repositories
2. sudo apt-get install qemu
3. mkdir ~/qemuImages
4. mkdir ~/qemuImages/FedoraCore1
5. cd ~/qemuImages/FedoraCore1
6. qemu-img create disk.img 20G
7. export SDL_VIDEO_X11_DGAMOUSE=0
8. qemu -boot -d -cdrom /dev/cdrom -m 512 disk.img
9. If your Fedora Core 1 CD is in the CD-ROM drive then qemu will boot the image and boot from the CD, then you can do the normal install routine. I did a “linux text” install. Mouse emulation was giving me problems, so I chose “No mouse.”

This entry was posted in All, Computers and tagged . Bookmark the permalink.

4 Responses to Bochs and Qemu

  1. Anonymous says:

    Where was Toro? Mom

  2. gdmqh says:

    Typo in qemu command line

    When I try to follow this I need to omit the “-” before the “d”, giving a command line like:

    qemu -boot d -cdrom sysreccd-1.2.0.iso -m 384 disk.img

  3. gdmqh says:

    Mouse works now

    I agree that the mouse used to be broken in qemu. You’d click on the window and it would say “Press Ctrl-Alt to Exit Grab” and you press ctrl-alt and the mouse is still grabbed. The only way out was kill QEMU, if I recall correctly.

    The qemu that comes with Ubuntu 8.10 is qemu 0.9.1-5ubuntu3. That version and perhaps some earlier versions apparently have the bug fixed.

    So I omitted the “export SDL_VIDEO_X11_DGAMOUSE=0” line and everything worked fine.

  4. Pingback: VMWare is impressive. « KingAnt.net

Leave a Reply

Your email address will not be published.