Installing Linux On USB Drive For VM

Just recently got a new laptop to replace my old desktop pc, a fancy 8core i7 Sony laptop. The first thing that comes to mind is do I stick with Windows 7 or put Linux? I decided to stick with Windows but use Linux in a VM so I still have both, because when it comes to ssh, I’d rather have a linux terminal. Then came the thought, what about installing Linux on a usb drive so I dont have to take up  any precious space on the 256GB SSD on the laptop.

Quick google search found me this article from First I went with VirtualBox because its an easy package to install versus VMWare and I just like its interface better 😛 Next up is VirtualBox wont let you boot from a usb drive, but the command line utility can define it as a virtual disk. Here things can get a bit tricky. Its easy enough to follow their directions, but what they do not point out is depending on whats attached and where, the physical drive number of the usb drive can change, which I found out when I rebooted the system. To get around this, I created another virtual disk file pointing to the new physical drive number. Now in case it changes again, I can just pick the relevant file to boot.

The next issue I came across was a weird error that VirtualBox threw. It was when the CentOS installer tries to write the new partition structure. The error gave the impression that it thought the drive was full and couldn’t write to it. After some poking around, I unplugged and plugged the usb drive back in to find that the previous partition was deleted and now it was an un-formatted device. Tried to install Linux again and this time had no problem. So might be a good idea to first remove all partitions from the usb drive first.

Finally I was able to install Linux, which took a long time. The flash drive is not very fast and even updating via yum was excruciatingly slow, but then this was more of a, ‘Hey, lets see what happens,’ kind of thing. After that I did try to boot off of the flash drive on another workstation, but it stopped at the failsafe grub menu. Basically it booted from the flash drive, but grub was unable to tell which partition to read from and thus no grub menu. I’m stopping here for now, we’ll see if I try again later.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s