For installation of Qemu refer here

My host is a debian distro.

After successful installation, every body wants to test how it works, here I share a small demo installing Ubuntu 12.10 inside qemu emulator.

Click here to download Ubuntu 12.10 desktop image, you will get an image file of somewhat 750MB (named as ubuntu-12.10-desktop-i386.iso).

Creating a disk image of 10G to hold ubuntu.

 $ qemu-img create ubuntu.img 10G

Confirm both disk image and ubuntu’s iso image at same directory,

 $ qemu-system-i386 -hda ubuntu.img -boot d -cdrom ./ubuntu-12.10-desktop-i386.iso -m 512

qemu-system-i386 – normal qemu command represented for x86 machine

-hda – refers to hard disk, here I used the same 10G hard disk image

-boot [ a | c | d | n ] – boot from floppy disk(a), hard disk(c), cdrom(d), or etherboot(n), you may note that I used ‘d’ here

-cdrom – since I am booting using cdrom, I need an iso image, which I replaced by ubuntu-12.10-desktop-i386.iso

-m 512 – I allocated RAM of 512 MB for the virtual machine.

On hitting enter, it will prompt with VNC server, you need a VNC viewer to see Ubuntu booting…refer bottom of this for VNC info.

Since it is Emulator, process of booting ubuntu may be slow, be patience to see how it is booting.


5 thoughts on “How to boot and run Ubuntu inside Qemu emulator and make a virtual machine

  1. I want to automatically run my command “dhclient eth0 -v” on my qemu vm starts, How I can achieve that?
    Is there a way to run a command on qemu VM from the host once its started


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s