Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

puppyscreenshot_20071008.jpg

Sometimes it’s nice to have a secure and familiar OS that you can use from any machine. Puppy Linux is just that: a really lightweight, CD-based Linux distribution, designed for maximum portability. If you’re using a PC, you simply boot and run Puppy Linux from a CD, storing your settings and changes to a file on your hard disk or flash drive. What’s awesome is that it’s so compact, you can fit an emulator, the CD ISO, and the save state files all on a flash disk or SD Card, making it one tiny little OS package that you can carry in your pocket.

Using Q, the OS X port of the QEMU virtual machine, you can create a small footprint, virtual Puppy Linux box that will run under OS X and fit on a flash drive. In addition to its portability, this is one of the easiest ways to get Linux running on your mac.

You could have a little portable Linux box running on your Mac in a half hour. So let’s get started.Download Puppy ISO and Install Q

  • Go to the Puppy Linux download page and get the latest ISO (currently 3.0) – Link
  • The latest Q version and documentation is here – Link
  • Grab the latest stable build, and copy the Q app to your Applications folder

Make a New Guest (Virtual) PC

puppy2_20071008.jpg

puppy3_20071008.jpg

  • Run Q, then click Guest PC -> New Guest PC
  • Call it Puppy Linux (or whatever), and select Q Standard Guest as the OS type/
  • Under general, unselect “set clock to host time”.
  • In the Hardware tab, set your RAM size to 256MB, pick the Soundblaster if you need audio (it eats a lot of CPU, so leave it out if you have a slow machine).
  • Make a hard disk image that’s appropriate for your storage device. I’m making a 1GB file that I can put on an SDCard. You probably don’t need anything near that much, since Puppy only stores save data there and promarily runs from the ISO. The qcow format will start out small, and grow to the file size you specify.
  • Under CDROM, select the Puppy Linux ISO that you downloaded.
  • Make sure to select Boot from CD-ROM. Puppy is set up to boot from CD and store saved settings to disk.

Start the Puppy Linux Install

puppy1_20071008.jpg

When you’ve finished updating the settings, click the little play icon to start booting from the ISO image. You’ll see the normal start-up stuff, and it’ll ask you a couple questions before booting X Windows.

Note: choose the XVesa server as your X server. The Xorg server didn’t seem to work for me and I had to restart the virtual machine.

puppy4_20071008.jpg

puppy5_20071008.jpg

Once X Windows loads, you’ll get to choose your video resolution. There weren’t any widescreen resolutions enabled by default, so I’m using 1024×768, which fits in a decent sized window.

Network Setup

puppy6_20071008.jpg

puppy7_20071008.jpg

You’ll also want to set up your network connection at this point. Just click on the connect icon, select the eth0, and set it up to use DHCP.

Format the Virtual Hard Disk

This is the only really technical step. Inside the virtual machine, Puppy can’t see your real harddisk or thumbdrive. Instead, we’ve created a virtual disk image that the emulator is able to see. At this point it’s just a raw drive that hasn’t been partitioned or formatted, so we’ll be making a ext3 partition on it. This will house all of Puppy’s save state information and is updated every time you shut down the Linux OS.

puppy8_20071008.jpg

puppy9_20071008.jpg

Click the console icon on the Puppy desktop to get a terminal window. Then use fdisk and mkfs.ext3 to partition and format the virtual disk. Your virtual disk will show up as /dev/hda. Refer to the images to see the details, but the cheat sheet is below.

# fdisk /dev/hda
n
p
1
return
return
w

# mkfs.ext3 /dev/hda1

puppy10_20071008.jpg

Finally, exit the console, and click on the drives icon. Select the /dev/hda1 disk you just made. It will now be mounted and available within Puppy.

Tell Puppy to Save to the New Virtual Disk

puppy11_20071008.jpg

puppy12_20071008.jpg

puppy13_20071008.jpg

Reboot the OS from the Puppy menu and you’ll be prompted to save your session. Choose the hda1 disk you made, and choose a save size that’s smaller than the full disk size.

puppy15_20071008.jpg

After you’ve chosen your save options, you’ll also be asked to copy some of the data from the CD ISO to this drive. Puppy doesn’t know you’re using a disk-based ISO instead of a CD, so it normally caches this stuff in RAM. To save a little RAM, choose “Yes” to copy this to your virtual disk. Puppy will treat this like a normal file and you’ll save some extra RAM and have a faster startup.

Puppy should then reboot with your saved settings intact. If Puppy stalls during boot saying it’s loading from the hard disk, you need to go back and make sure your settings are configured to boot from the CD ISO.

Put your Puppy on a Flash Drive

You may want to copy the Q application binary, Puppy ISO, and virtual machine files over to your flash drive. This will let you run your private OS on any mac you happen to be on. You’ll need a little space. The Q virtual machine is about 25MB. The Puppy ISO is about 100MB, and your virtual machine files will grow to the size of the hard disk you created. Depending on how big of a drive you make, you should be able to squeeze everything on a 256-512MB drive quite easily.

Do the following:

  • Copy Q.app from the Applications folder to your flash drive
  • Copy the Puppy ISO to your drive
  • You’ll find the virtual machine state file (.QVM) in your Documents/QEMU folder. Copy that one too.

My SD Card drive is pretty slow, so an alternative is to put the Q binary and the ISO image on a CD. Doing this will shorten your boot time, as well as the time to load any applications from the ISO image.

Update the .QVM Package’s CD Path

However you set things up, you’ll need to edit your virtual machine config and adjust the settings to point to the new location of the ISO. This is most easily done by editing the configuration.plist file inside the .QVM package.

Just right click the .QVM file on your flash disk, and click “Show Package Contents.” Open the configuration.plist file in TextEdit or Property List Editor and look for the long string that contains the parameters for the virtual machine. If you adjust it so that it contains “-cdrom puppy-3.00-seamonkey.iso” instead of a full file path, you can move the ISO file right inside the QVM package and have a self contained package that contains both the ISO and hard disk image.

You can now hop on any computer, run Q.app from the flash disk, and then drag the .QVM file to the Q icon on the taskbar. Your private little Linux box will boot right up! For bonus points, drop a Windows and Linux QEMU executable on the drive too. You should be able to boot your same Linux virtual machine on all three platforms. How slick is that?

Other Resources:
Lifehacker’s Taking Puppy Linux for a Walk – Link
Puppy Linux downloads and community forum – Link
Q (QEMU for OS X)- Link
QEMU open source processor emulator – Link


Related

Comments

  1. wayn3 says:

    I’m avoiding Puppy Linux for the following reason:
    http://www.oreillynet.com/linux/blog/2007/10/a_death_threat_from_a_puppy_li.html?CMP=OTC-0O724Z062301&ATT=A+Death+Threat+From+A+Puppy+Linux+Supporter

    The info in this article would be good for trying out other distros.

  2. jason_striegel says:

    Yikes! It’s a drag to hear that happened.

    As wayn3 mentioned, you can use the bulk of these instructions to install another distro if you desire. Damn Smal Linux and SLAX both have really good reputations.

    DSL – Link
    SLAX – Link

    Too bad passionate users aren’t always more motivated to wrangle code than to run around threatening people.

  3. buzban says:

    great article, thank you. just enough detail, and great visuals to help me through the process. very cool!

  4. byoung says:

    thanks this really helped me figure out how to save my configurations and files on guest Slax using Mac OSX as host :)

  5. Anonymous says:

    The “Export Guest PC to Flash Drive” will make a standalone application that will just run the .qvm file. So you dont have to copy the files. It can only run the virtual machine that was exported though.

  6. Anonymous says:

    I have a copy of puppy on a bootable usb drive that I am able to use on PCs. Has anyone adapted the method with Q above to access such a puppy instance from within OS X?

  7. Anonymous says:

    The “death threat” article is ridiculous. A distro doesn’t characterize the people who use it. And a person who uses a distro (and in this case, even more oddly, only once) can’t characterize the distro.

    This idea of generalizing … in this case, to a group of people (Puppy Linux users) and a whole operating system from one blog incident and an anonymous poster is the really stupider problem. Generalization.

    During the war, people killed dogs like dachshunds and german shepherds in the US because they were characterized as german. Apparently the dogs themselves were unaware of this connection.

    Likewise the (in my experience) helpful friendly and open minded folks I read and respond to on the puppy forum. Apparently, now they’ve been portrayed as threateneing fanatics, and one poster above is actually removing puppy Linux from his or her computer!

    Gosh, I use Puppy Linux and am happy to. And I think it’s great if others use other operating systems that they like, as well.

    I would like to point out that using Puppy Linux hasn’t caused me to issue death threats. Or even resent others for using other OS’s.

    So, if you are tempted to try it yourself, such behavior is definitely not a contagious Puppy Linux disease, and doesn’t come bundled with the operating system itself. You can relax. Puppy Linux won’t turn into a blog threatening monster.

    Just the opposite, really. I’ve actually found that Puppy linux is a fun distro, without a lot of attachment to the serious in its basic nature. A droopy puppy for a wallpaper mascot tends to interfere with the idea of fanatacism in my opinion — who could possibly believe in a Puppy Linux fanatic in the first place? It’s a joke.

    In fact, the idea behind Barry Kauler’s (the original developer’s) efforts was simply to make something small, and useful, and filled with simple and fun programs, and give people the ability to customize that to their own tastes and preferences. Rewrite the whole OS even (via an included re-master program) Hardly the stuff of fanaticism. More like respect for individualism and differences of opinion.

    I find it odd therefore that one dysfunctional and rambling blog entry by an anonymous person, who claimed not to even use Puppy Linux has now tarred anyone who puts a Puppy CD into their drive.

    Please, a real Puppy user, here, suggests trying it out, or not, I have respect for you either way. The Puppy forum is also a place you might visit, or not, to see for yourself just how frightening Puppy people really are. May peace and happiness shine upon you either way.