This is something I’ve always thought would be useful- a small linux distro installed on a thumbdrive. I’m not talking about an in-memory install; not knoppix. I want to be able to boot from within windows, but still save my stuff to the thumbdrive. I’ve used MS Virtual PC and that works ok but I’ve never managed to get x windows running with it. I’ve seen examples online of how to do that but it’s never worked for me.
There are a lot of Qemu/DSL examples online, but most of them are just running an in-memory linux distro off a thumb drive. That’s not very exciting to me. I need the filesystem so I can store stuff.
I initially followed this example which looked promising, but it never worked for me. It wouldn’t perform the actual HD install.
I’ve tried a few other VM products but they’re either not open source, or don’t work, or both. This isn’t my main area of work; I need something easy to work with.
After several attempts, I’ve gotten something working using Qemu and DSL. Here’s what I did:
Download and install qemu – this you do by unpacking the binary distro in a directory on your thumb drive.
Create a disk image. The format that worked for me was “raw”. There are other options, some I suspect would be faster, but this is what worked for me. I named my image file mylinux.img, but that’s arbitrary. 3G means I created a 3 gig disk image on my thumbdrive.
./qemu-img.exe create -f raw mylinux.img 3G
Install linux. The command below specifies the base directory “-L .”. This is important as it tells qemu where to find the files it needs. “-m” specifies the amount of memory to allocate. “-hda” tells it what disk image to use, “-cdrom current.iso -boot d” tells it to boot the iso. We’re pretending it’s like a cdrom boot.
./qemu.exe -L . -m 500 -hda mylinux.img -cdrom current.iso -boot d
Go through the standard install process, starting with the partitioning of the drive, which is hda in this case. At the prompt once DSL boots, I typed “install”. I tried several times to do a HD install from within DSL, that is, after it boots as in-memory, but I was never able to mount hda to do the install. I also had trouble installing the grub boot loader, so I used lilo instead. Once the install finished and rebooted, I killed the process and reran to finish the setup:
./qemu.exe -L . -m 500 -hda mylinux.img -boot c
I initially tried to specify the USB mouse I’m using, but that didn’t work at all. I cancelled out of the mouse detection, and the default worked fine for my laptop.
Post a Comment