Portable Linux on my Thumbdrive.
I'm a big fan of
Make and an even better fan of their blog (helped by the fact that Philip Torrone maintains it). I recently got my attention grabbed by
this post showing
this one (furry goat, haha): transport your own Windows CE image and emulator along on your thumbdrive. Wherever you go, just pop in your thumbdrive and you see all your apps, bookmark and whatnot.
Only problem: it's Windows CE. Designed for PDAs and mobile devices, won't run anything but CE apps. Especially won't run Firefox. And also there is the (not even asked) question of licensing. I'm too lazy too dig, but I'm pretty sure Microsoft did not intend their emulator to be used in that fashion.
It's a cool idea though. So I just wanted to roll my own. From what I did, it seems even simpler than the Windows CE version.
Step 1: aquire software.
I mean, download software. You need:
Did I mention it was all done with free/opensource software?
Step 2: configure and install.
Unpack your QEMU somewhere. Use the
qemu-img.exe command to create a file for the hard disk image. I successfully fit a DSL install in 150 MB. It's pretty tight though, I have only 10MB left after install. I named my file c.img.
You should also have the DSL iso handy. I suggest that you copy it in the qemu folder for convenience. Mine is named
dsl-1.5.iso. You only need it there for installation. Open a command prompt and start the emulation with this:
qemu.exe -L . -m 192 -hda c.img -cdrom dsl-1.5.iso -boot d -enable-audio -localtimeSee the qemu doc for the meaning of it. -m 192 is the amount of memory to use for the guest OS. Obviously should be adjusted according the the amount of physical memory you have.
If everything goes well, DSL should boot and you should be looking at some X desktop. Open an xterm there (as root, just spend a minute getting familiar with the shell. Right click on the desktop, that's pretty much all you need to know). You need to create a
partition on you virtual hard disk. Use fdisk for that. If you don't know how what or why, google it. star fdisk like this:
fdisk /dev/hdaThen at the prompt, it's probably a similar series of command like this (from memory) n, p, 1,
, , w. This should create a new primary partition named hda1, filling the entire space of the virtual disk.
Then run the dsl installer:
dsl-hdinstall
And follow the onscreen instructions. At the end of the installation, you should just close the emulated os. Relaunch qemu without the cd image.
qemu.exe -L . -m 192 -hda c.img -boot c -enable-audio -localtime
And then finish the install. With hat last command, I also created a batch file so I just double click to launch the emulation. You can also remove the dsl-1.5.iso as this time.
There you have it. A fully emulated OS. Portable. Litterally. Copy the qemu folder on your thumb drive and you are good to go.
Inspired/related links:
http://www.frontiernet.net/~beakmyn/pictureframe/ this is where I learned about DSL.
http://www.oszoo.org/download.html good help, eplanation, premade images for qemu
http://ashishpatil.blogspot.com/ where I learned about qemu. Originally, I tried to use bochs (
http://bochs.sourceforge.net/) but the emulation is so slow that it is unusable.
http://m2.dad-answers.com/qemu-forum/ the qemu forums. Quite helpful to figure things out.
http://www.makezine.com/blog/archive/2005/09/how_to_portable_ce_20.html the make post that gave me the idea to roll my own.
http://www.furrygoat.com/2005/09/portable_ce_20.html the one with Windows CE emulator. (furry goat!)
Here's screenshot with my install running: