Wednesday, September 21, 2005
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 -localtime

See 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/hda

Then 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:

 
Comments:
Good little tutorial. I wasn't even aware that qemu existed! I now have a portable linux image to carry around on my iPod mini.
 
Useful tutorial. I reached this page searching for linux distributions.
 
brillaint man! I'm a bit behind...but it's running...I kinda got a qemu running for linux and windows off the same qemu directory...

Thanks for the tutorial!
 
This post has been removed by a blog administrator.
 
What's the current version of QEMU I should be using for portable linux?

Better yet, can you provide a link? Thanks! Great tutorial!
 
I used 0.7x for this tutorial, but version 0.8 came out and it works just as good. I usually google it and find it in the first 3 hit. The project is fairly stable, so any recent version in the last 6 month should be good.

http://www.google.com/search?q=qemu
 
So, what is it that we have on the USB disk? An installtion that allows to go to the library and have Linux w/o installing anything on their PC nor rebooting it, that we can start by simply inserting it into USB socket? I am not at all familiar with QEMU, so I'm asking for some basic info.

Stan Berka
 
Eerst Europa Doelstellingen: De Ci2i Verzekering (Ci2i) zal het nummer een gebrandmerkte pan Europese commoditized online verzekeringsmakelaar door 2010 zijn.
 
Very informative tutorial..
However I could not get the hdinstall to work. Could you please revise the hdinstall part. The instructions are somewhat vague for me.
Really appreciate your help if you could please be more specific about hdinstall part.

Thanks
 
Please could someone copy the portable linux and put it on a cd because this is too too hard.
tahnks
 
I have been using the easy to follow tutorials found at Pendrivelinux

Hope this helps! :)
 
Oops, the URL didn't work. Here it is again. Pendrivelinux
 
Post a Comment

<< Home
This is where the description should be. However, being lazy, I chose to type this text instead of a description.