Jump to content


EeePC in QEMU


47 replies to this topic

#1 TundraMan

    Member

  • Members
  • 10 posts

Posted 26 November 2007 - 06:13 PM

After much tweaking and fiddling my man Zedd and I have managed to get the default EeePC software to run under QEMU. Why? this allows us more latitude as far as messing around with the system and until the wireless and ACPI issues are resolved neither of us want to rush to remove the default OS. This will allow us to install tools for software development outside of the EeePC ... and so much more.

Posted Image

So here are the steps. We are using Ubuntu Gutsy as a host, if you are using a different host your mileage may vary but the recipe should be much the same. (ensure you have qemu, and parted installed on your system and install other stuff as needed but these are the core tools)

1. Open a terminal create a new directory and cd into it
2. Extract the image tarball from the CD (P701L.gz) into your fresh directory
3. Create a new disk image file 'qemu-img create good.img 4001M'
4. dd the P701L image into the new image 'dd if=P701L of=good.img bs=512 conv=nocreat,notrunc'
5. Figure out the next available loop device 'sudo losetup -f' (use the returned number in the next step)
6. get the image as a device 'sudo losetup /dev/loop0 good.img' (again replace 0 with the right number from 5)
7. ensure this was successful 'echo $?' should return 0
8. partition the second drive 'sudo fdisk -C 486 /dev/loop0'
9. create the partition: n, p, 2, <enter>, 484, w
10. format the partition 'sudo parted /dev/loop0', mkfs, 2, ext2, Ignore, Ignore, quit
11. remove the loopback device 'sudo losetup -d /dev/loop0'
12. create a mount point for the loopback 'sudo mkdir /mnt/loop'
13. mount the first partition 'sudo mount -o loop,offset=32256 good.img /mnt/loop'
14. Fixup the xorg.conf file. 'sudo vi /mnt/loop/etc/X11/xorg.conf' change intel to vesa and screen resolutions to 800x600 (I will post the updated xorg.conf in a followup post)
15. umount the loopback file system 'sudo umount /mnt/loop/'

You disk image file is now ready to go. With ubuntu the bios.bin file shipped with qemu will not function so we have to grab the newest one from http://bochs.sourcef...getcurrent.html. very important --> Download the latest source tarball. From the tarball extract the 'bios/BIOS-bochs-latest' and copy it over the existing /usr/share/qemu/bios.bin file <--very important. You are almost there now.

* run qemu 'qemu -hda good.img -m 512'
It will format the second partition as ext3 and ask you to hit enter to reboot. Hit enter.
VOILA!!! you should see a familiar sight as the gui starts and asks you for username, timezone etc...

A few notes.
* I have noticed that if you don't shutdown 'nicely' you sometimes have to clear all files from /tmp in the image for X to start as an old lock file sits in there
* I have had to clear out /var/log in the image from time to time
* A stream of ata errors causes the emulation to be slow, we are working on this
The first two notes may no longer be an issue but were found to cause problems while we worked on getting this going.

Enjoy,
TundraMan and Zedd

Edited by TundraMan, 26 November 2007 - 08:55 PM.


#2 Kibobo

    Senior Member

  • Members
  • 295 posts
  • LocationFrance

Posted 26 November 2007 - 06:16 PM

Same with VirtualPC: http://www.blogeee.n...c.php?f=2&t=200

Edited by Kibobo, 26 November 2007 - 06:20 PM.


#3 TundraMan

    Member

  • Members
  • 10 posts

Posted 26 November 2007 - 06:20 PM

xorg.conf
------------------------snip-------------------------------
Section "ServerLayout"
Identifier "Xandros"
Screen 0 "Screen1"
InputDevice "keyboard"
InputDevice "mouse"
EndSection

Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
EndSection

Section "ServerFlags"
Option "AllowMouseOpenFail"
Option "BlankTime" "5"
Option "DontVTSwitch" "true"
Option "AIGLX" "false"
Option "GLX" "false"
Option "GLCore" "false"
EndSection

Section "InputDevice"
Identifier "keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbLayout" "us"
Option "XkbVariant" ""
EndSection

Section "InputDevice"
Identifier "mouse"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "Protocol" "IMPS/2"
Option "Emulate3Buttons" "yes"
Option "ZAxisMapping" "4 5"
Option "CorePointer"
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "ASUS"
ModelName "eeePC P701"
Modeline "800x480" 29.58 800 816 896 992 480 481 484 497 -HSync +Vsync # 60 Hz
EndSection

Section "Device"
Identifier "Device1"
Driver "vesa"
EndSection

Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Depth 8
Virtual 1680 1680
EndSubSection
SubSection "Display"
Depth 15
Virtual 1680 1680
EndSubSection
SubSection "Display"
Depth 16
Virtual 1680 1680
EndSubSection
SubSection "Display"
Depth 24
Virtual 800 600
EndSubSection
EndSection

#4 Kibobo

    Senior Member

  • Members
  • 295 posts
  • LocationFrance

Posted 26 November 2007 - 06:21 PM

You don't have to add the ethernet driver ?

EDIT: indeed, your ethernet interface is off.

Edited by Kibobo, 26 November 2007 - 06:29 PM.


#5 TundraMan

    Member

  • Members
  • 10 posts

Posted 26 November 2007 - 06:50 PM

@Kibobo, yes I will be getting the ethernet to work and don't anticipate this to be an issue. VirtualPC is for Windows only no?

On a side note you can run from the loopback device rather then the disk image file. Simply mount the disk image file 'sudo mount -o loop,offset=32256 good.img /mnt/loop' and run QEMU 'qemu -hda good.img -m 512 -kernel /mnt/loop/boot/vmlinuz-2.6.21.4-eeepc -append "rw root=/dev/sda1"'. This will bring you to the standard KDM login screen. I haven't worked out all the bugs yet but one thing you will have to do here is drop down to the terminal and set the 'user' password via passwd.

#6 pmeee

    Senior Member

  • Members
  • 545 posts
  • LocationEee PC 4G White w/Xandros - UK

Posted 26 November 2007 - 08:05 PM

Wow you guys rock! Nice work. I've been wondering how easy it was to clone the system.

#7 ermes

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts

Posted 26 November 2007 - 10:29 PM

good work!! I'd like to test xandros eeepc.... but I do not have the rescue dvd... any helps...?

#8 DecIRC

    New member

  • Members
  • 1 posts

Posted 04 December 2007 - 05:11 PM

Hi there...
Isn't there a way to do it with VirtualBox ?

Regards
cEd

#9 cannondale0815

    Member

  • Members
  • 28 posts

Posted 08 December 2007 - 05:54 PM

Quote

This is sweet! Works like a charm in VirtualPC 2007 (which can be freely downloaded from MS). I had to run the French instructions through Google Translator, but it's quite usable:

http://translate.goo...&hl=en&ie=UTF-8

Edit: I had to set the networking interface in the VirtualPC settings to "Shared networking (NAT)" for networking to work. But it works like charm :)

Edited by cannondale0815, 08 December 2007 - 06:13 PM.


#10 cannondale0815

    Member

  • Members
  • 28 posts

Posted 08 December 2007 - 05:57 PM

Quote

good work!! I'd like to test xandros eeepc.... but I do not have the rescue dvd... any helps...?
There's a torrent out there.

#11 ermes

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts

Posted 09 December 2007 - 11:22 AM

is it a file .iso of 1230.8 MB?

#12 cannondale0815

    Member

  • Members
  • 28 posts

Posted 09 December 2007 - 11:06 PM

yes, that's about right.

#13 vofiwg

    Senior Member

  • Members
  • 322 posts
  • LocationGermany

Posted 10 December 2007 - 07:06 PM

Quote

On a side note you can run from the loopback device rather then the disk image file. Simply mount the disk image file 'sudo mount -o loop,offset=32256 good.img /mnt/loop' and run QEMU 'qemu -hda good.img -m 512 -kernel /mnt/loop/boot/vmlinuz-2.6.21.4-eeepc -append "rw root=/dev/sda1"'. This will bring you to the standard KDM login screen. I haven't worked out all the bugs yet but one thing you will have to do here is drop down to the terminal and set the 'user' password via passwd.
I tried this and it works with one exception: If i login in kdm it throws me back to the kdm login again. It's an endless loop. I have to do a "console-login". There i can login and start x by doing a "startx /usr/bin/startsimple.sh".

Running "qemu 'qemu -hda good.img -m 512'" does not work for me.


vofiwg

sorry for my poor english. hope you understand it.

#14 TundraMan

    Member

  • Members
  • 10 posts

Posted 12 December 2007 - 02:04 PM

@vofiwg: yes I seem to recall similar behaviour when doing things with the image mounted as a loopback device. I must of changed something to get it to work but unfortunately I do not know what. I will try to look into this but only have little time so I can't promise you a fix. Since my original post I have installed Kubuntu on my Eee and really only use QEmu to verify things every now and then.

PS. Your english is very good, much better then my German :)

#15 sjones411

    Member

  • Members
  • 26 posts

Posted 12 December 2007 - 02:36 PM

Has anyone tried to get this working under Parallels or VMWare on the Mac? I'd really like to try this out but I don't want to emulate a system emulating another system.

#16 vofiwg

    Senior Member

  • Members
  • 322 posts
  • LocationGermany

Posted 12 December 2007 - 07:33 PM

Quote

@vofiwg: yes I seem to recall similar behaviour when doing things with the image mounted as a loopback device. I must of changed something to get it to work but unfortunately I do not know what. I will try to look into this but only have little time so I can't promise you a fix. Since my original post I have installed Kubuntu on my Eee and really only use QEmu to verify things every now and then.
I was able to figure it out on my own. All I have done is to insert a

-initrd /mnt/loop/boot/initramfs-eeepc.img
in the commandline.

So the whole thing after mounting the loop is:

qemu -hda good.img -m 512 -kernel /mnt/loop/boot/vmlinuz-2.6.21.4-eeepc  -initrd /mnt/loop/boot/initramfs-eeepc.img -append "rw root=/dev/sda1"'
That worked for me. Hope it does for anyone who tries it too.


@sjones411: There's a port of qemu for Mac-OS. It's available here http://www.kju-app.org/kju/

vofiwg

#17 vofiwg

    Senior Member

  • Members
  • 322 posts
  • LocationGermany

Posted 12 December 2007 - 10:14 PM

I converted the good.img to img for VirtualBox with

VBoxManage convertdd good.img eeepc.vdi
and fired it up.

It works great.

That all helps me waiting on my real EeePC. It is not yet available here :-(


vofiwg

#18 vofiwg

    Senior Member

  • Members
  • 322 posts
  • LocationGermany

Posted 12 December 2007 - 10:25 PM

Another work:

vmware-server

Convert the qemu-Image to a vmware-image:

qemu-img convert good.img -O vmdk eeepc.vmdk
Now i am able to run it on vmware :-)

vofiwg

#19 stenk

    Senior Member

  • Members
  • 126 posts

Posted 13 December 2007 - 01:38 AM

Very interesting thread guys!

I will try this tonight. Many thanks for all your input everyone.

#20 Foppel

    Member

  • Members
  • 10 posts

Posted 20 December 2007 - 12:03 AM

Hi folks,

thanks all for this good work. I build my own image with Ubuntu 7.04. It's important to use for the first start the ramdisk parameter:
qemu -hda good.img -m 512 -kernel /mnt/loop/boot/vmlinuz-2.6.21.4-eeepc -initrd /mnt/loop/boot/initramfs-eeepc.img -append "rw root=/dev/sda1"'
Then I umount the loop device and agree to the licence and restart with the short command: 'qemu -hda good.img -m 512'

I wrote a new entry in the german eee-pc wiki, i linked it to this thread. I hope that's OK:

http://wiki.eee-pc.d..._Recovery_Image

greets from germany - Foppel

Edited by Foppel, 20 December 2007 - 11:38 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users