VirtualBox

Trust the Sidux.com Home Page

Send to Kindle

If I detailed all of the hurt I caused myself (entirely my fault) in this one post, I’d be typing for hours. I’ll spare myself (and you) all of the gory details, and summarize.

If you follow my techie posts (way fewer than my music posts), then you know that I’m a big fan of Sidux. Most recently, I had settled on the Xfce flavor (for speed and simplicity), and I run it all under VirtualBox on my Windows Vista Ultimate x64 laptop.

I built the original installation on a dynamically-sized virtual disk, maximum size 4GB. That seemed like plenty of space, since Linux is not my primary OS, just a place to play around in, and to be safer when appropriate.

For yucks, and mostly because there’s nothing production about my installation, I got into the habit of keeping up-to-date on the bleeding edge. That meant regularly typing:

apt-get update

apt-get upgrade

apt-get dist-upgrade

I think the middle step is unnecessary, but I do it more often than not anyway. Up until recently, I never had a problem with that.

Back to the disk space situation. I had over 1GB free, for a long time, which seemed like plenty of headroom, given that I don’t really create new content on Linux. Then I decided to experiment with a few apps on Linux (some of which are only available on Linux), for HTML editing and other web creation tools.

Once I installed a bunch of them, and continued my dance of dist-upgrading regularly, my disk space got closer to the 4GB max, without me paying any attention to it. Then, during one dist-upgrade, I temporarily ran out of space (during the actual upgrade, while extra space is necessary to unpack things, run scripts, etc.). One or two steps in the upgrade failed to install (due to disk full errors), but most of the upgrade went fine. In fact, I had 86MB free after the ugprade, and things appeared to be OK.

That’s all background to my comedy of compounding errors that ensued. It began with a bit of hubris (too much cleverness on my part). Knowing that I just dist-upgraded myself into a full disk, and knowing that to correct it, at a minimum, I’d need to run a normal upgrade, I decided to shutdown Sidux, rather than reboot it, thinking I would avoid any booting problems with the just-failed dist-upgrade.

I then searched for how-tos on growing a VirtualBox disk (having some instincts as to what I could do even if I didn’t find an answer). I found some multi-page forum posts that confirmed my instinct.

I created a new fixed-size 8GB virtual drive. I then attached the old one and the new one to an instance of CloneZilla (under VirtualBox, obviously). I let it do a disk-to-disk copy. Unfortunately, I also told it to grow the partition on the target drive to fill all of the space. I say unfortunately, because the target disk ended up being full at 8GB, so something went wrong on that end.

This is one of the points where I’ll spare you tons of gory details. Suffice it to say that I eventually got the target disk to be a perfect clone of the original disk, with the additional 4GB of free space now correctly recognized.

I finally was ready to attach the new drive to the Sidux VM, and boot it up, expecting to do an upgrade afterwards, and be back to normal. Wrong…

When I booted, I saw a different Xfce splash screen. The dist-upgrade had given me the new Xfce 4.6, and (unbeknownst to me) also the Xorg 1.6 upgrade. I ended up with a working X installation, but a non-working Xfce one. In other words, the graphical environment was up, but I had no menu system (at all), with no ability to right-click on the background to bring one up. The only working icons in the dock were the web browser, and the log off one.

Here’s where I ended up wasting a stupid amount of time. Basically, I assumed that my clone of the hard drive failed, so I went down a few wrong paths trying to correct that. I even went so far as to install from the Sidux CD over again, onto the new (reformatted) 8GB drive. But, like a complete ass, I immediately dist-upgraded after the install.

Guess what? My system was hosed exactly the way it was before! That made me boot off my old, full 4GB drive, and sure enough, same menu problem. So, the clone of the disk went fine, it was the dist-upgrade that had screwed me.

But, I was still too thick to realize that. I thought (at this point completely foolishly!) that it was the fact that the disk filled up during the dist-upgrade that caused my problem (a now ridiculous assumption, since the same problem occured on a fresh install into a large disk). So, I wasted a little more time trying to remove and reinstall certain packages, all to no avail.

Then, I finally followed the advice I give in the title of this post: Trust the Sidux.com Home Page!

Right there on the home page, they tell you exactly when it is not safe to do a dist-upgrade, and why. Of course, just my luck that I happened to do a dist-upgrade at the wrong time, and, at the same time, happened to run out of disk space, causing me to misdiagnose my problem!

Is there a happy ending to this story? Yes, but I’ll skip a lot more pain and cut to the chase.

I never did get Xfce 4.6 running correctly, even long after the Sidux.com home page said it was OK to do a dist-upgrade again. Instead, I decided to take advantage of another announcement on the home page, claiming that KDE4.2 was now available (for a while, it too was the cause of a no dist-upgrade warning). I have always liked KDE and only avoided it to avoid bloat. Given that I couldn’t easily get Xfce working again, I decided to give the new KDE a try.

While I have some complaints about the menu layout, I basically liked the look of KDE4, and I liked the quick launcher, which made the menuΒ  layout less important to me. That worked fine for a couple of days, and then I did another dist-upgrade (no warnings against it on the home page!), and I lost X completely. I could only log in on the command line.

After a little poking around, somehow, during the upgrade, all of my display managers had disappeared from /usr/bin. In this case, specifically, there was no /usr/bin/kdm. No idea how that happened, but doing an apt-get install kdm solved the problem, and I’m now back in business. I can even do a dist-upgrade and everything continues to work, so I appear to be beyond the previous problem.

It’s quite possible that all I would have needed to do is to install xdm (like I had to install kdm) to get Xfce running again. I might try that in the next few days if I get some time.

Anyway, even though I had a ton of frustration over the past 10 days, none of it was the fault of Sidux. In fact, they tried to save me from myself, something that others have failed to do many times in the past as well.

Another learning experience is in the tank now, and another happy ending, since I don’t mind having experienced the new KDE either. πŸ™‚

OpenVPN in VirtualBox

Send to Kindle

There are a number of reasons why you might want to run a VPN on your laptop. The most obvious is that you have to, in order to access files back at the office. Two other likely reasons are security (you are in a public place, and want to encrypt all traffic) and unfettered access (your provider is blocking certain ports or services).

I’ve been interested in implementing a VPN for a while now, but haven’t had any real need, nor tons of copious free time. On Friday, I was informed that one of my portfolio companies had installed OpenVPN and I was welcome to install a client and test it.

I am running Windows Vista Ultimate x64 (the x64 sometimes being problematic with certain software). It turns out that the latest release candidate for OpenVPN has full Windows x64 support, so that wasn’t going to be an issue.

I installed the software, edited the configuration files that the office sent me, fired it up, and it worked the first time. Cool. I tested a few things, including accessing hosts that I wouldn’t be able to see unless I was in the office, and it all seemed to work correctly.

Then I hit a small snag. I tried to fire up my fat-client brokerage application. It behaved as if I didn’t have a network connection, or more accurately, like it couldn’t find the server it wanted to home to. I suspect that this could be something as simple as whether the office itself is set up to route out this type of app/port/protocol through the VPN (I know for a fact that this specific app works when I am in the office).

I also suspect that other fat clients, like a Poker app, might have similar troubles. That got me thinking about the additional use cases beyond just needing access to files/apps/machines in the office.

I fired up VirtualBox, specifically with my new favorite Sidux distribution. I tried to install openvpn from the repo, but it wasn’t found. A Google search said that openvpn is included in Debian itself (which Sidux is based on), so I was temporarily puzzled. I had the following line in my sources:

deb http://ftp.us.debian.org/debian/ sid main

I added another line, identical to the one above, substituting de for us. Presto, openvpn was found, and installed smoothly.

I copied over the same config files from my Windows directory, fired up OpenVPN, and was connected to the office again. This time though, in a pretty cool configuration. Everything in Linux (Sidux), was routed through the VPN. Everything in Windows, was routed normally though my FiOS connection.

If I wanted access to something on the corporate lan, use the browser in Sidux. The brokerage app just worked as normal, as it was unaware of the VPN. On a number of levels, this is the best of both worlds.

Of course, I already summarized situations when you may want/need the full VPN, for the entire machine, or when this use case might be better. If you’re in a public hotspot, and want everything encrypted, even your personal surfing, the Windows-level VPN makes sense.

If you’re in a client’s office, and can’t connect to an odd port on your home server (e.g., you have an application running at http://www.mycompany.com:8765/) which is blocked by your client’s firewall, then you fire up the VPN in the VM, and use that browser, while not disturbing the rest of the applications on your desktop.

This also gave me the idea that since putting Linux on a USB stick is so trivial (see this post about multi-boot USB), it would be simple to have a bootable USB stick, with the OpenVPN client on it (password-protected, of course), that would allow you to boot off any PC/laptop as if you’re in the office, or without leaving any trace on the host PC, whenever the situation called for it. Friends wouldn’t need to feel that you were seeing their browsing history, etc.

Just for yucks, I also installed OpenVPN on my server, for the secondary scenarios mentioned above (security and unfettered access). While I don’t anticipate needing them frequently, knowing that it’s available, on a second’s notice, is a comfort.

Another trick added to my bag. πŸ™‚

Sidux Wins Again

Send to Kindle

Almost two years ago, I wrote a post about an ancient (and very broken) laptop. Of the various Linux distributions that I tried on it, I really liked Sidux the most. I wrote about it in my In Praise of Sidux post.

I ended up trashing that laptop when the unreliability was more annoying that the brief moments that it would actually work (entirely a hardware issue, not a Sidux problem!).

A while later, I loaded a number of distros under VMware Player on my old XP laptop. Of course, Sidux was one of them. Unfortunately, I had problems getting X to work at greater than 800×600 (don’t know if it was a VMware problem, or a Sidux one, but as I noted in this post, I didn’t need it badly enough to track it down).

I’ve recently written about Virtualbox and how I got it to work with a multi-boot USB drive. In that post I mentioned the two main reasons that I boot Linux in a VM. I left out a use that is perhaps better, though I haven’t been disciplined enough to actually do it frequently. It’s almost the ideal way to surf to potentially dangerous websites, in particular, if you’re using a Live CD iso image to boot from. There’s simply nothing to infect on the part of the bad site!

Given how many malicious sites there are out there, it’s something I considered doing more often. In preparing, I decided that I wanted a tiny distribution, since I didn’t need to do actual work in Linux (e.g., I didn’t need an office suite, etc.). That said, I wanted two things:

  • Latest Firefox
  • Ability to build the VirtualBox Linux Additions

Both of those conspire against using something like Damn Small Linux (DSL, which I like), because it tends to use Firefox 2.x. I read a bunch, and Absolute Linux (12.2.1) sounded pretty good. I got it running quickly, and was even successful in getting the VirtualBox additions installed. I ended up giving up on it reasonably quickly for two reasons:

  • I couldn’t get the resolutions to be as flexible as I wanted, even with the additions installed
  • Package management was quite sparse and I wasn’t interested in going down the path of building tons of packages from source

In the past, I had success with Puppy Linux. I downloaded 4.1.2 and liked it instantly, much more than the 2.x and 3.x series that I had used before. Very attractive, very fast (booting and running). I really liked the unionfs filesystem. After trying reasonably hard to make this one work, I gave up (also for two reasons):

  • I couldn’t get Xorg to work under VirtualBox, but Xvesa worked flawessly
  • When I booted Puppy natively (from a USB drive), it couldn’t handle my Intel 5300 (a/b/g/n) wireless card (though NAT worked under VirtualBox perfectly)

Xorg worked flawlessly in native boot. Not having it work under VirtualBox meant no seemless mousing between Linux and Vista, a non-starter for me. VirtualBox couldn’t even find Xorg. πŸ™

I hesitated to even look for Sidux, because I didn’t want a DVD-sized ISO file. Reluctantly, I went to the site anyway, and found that the 2008.4 release had multiple versions, including a 395MB CD ISO with Xfce instead of Gnome or KDE. That was very attractive to me, as I’ve liked the simple and clean interface of Xfce on other smaller distros, and I didn’t have a need for a more complex framework for multi-app work.

I downloaded the ISO and booted it in VirtualBox. Everything worked perfectly, instantly. When I say everything, I mean everything. I wrote a post a while ago about how Ubuntu worked out-of-the-box under VMware Player, and I didn’t understand how. Now I do. The VirtualBox additions are already built in with Sidux (or, perhaps, VirtualBox recognizes Debian, and supplies the correct drivers to fool the operating system).

The point is that I could definitely run Sidux as a Live CD if I wanted. Pretty darn cool. But, I decided to install it to a virtual disk anyway. This way, I could have a customized installation with my SSH keys, aliases, plugins, etc. It would also make it less painful to upgrade to the latest versions of packages (instead of waiting for the entire distro to be updated on a new CD).

So, I installed it, and the VirtualBox additions (because I wasn’t sure whether the latest version, 2.1.0 was there by default). It’s simply fantastic. I can copy/paste across Vista and Linux. I can move the mouse seemlessly between the desktops. I can change the resolution if desired, including going to a full 1920×1200, going full screen, making the machine appear to be a native Sidux Linux one (Vista simply disappears completely). Then, without rebooting, I can just change the resolution back to 1400×1050, which fits nicely within the Vista desktop.

I have shared folder support (which I mount at will, so a virus can’t infect Vista since I only mount if I need to move a file from one environment to the other). I have full USB support to the virtal machine (so I can read/write from a USB stick from Linux). Like I said above, it all just works.

So, while I am glad that I learned a bit about some other distros (in particular, Puppy 4.1.2 which is really great), Sidux wins again for me. It’s simply a fantastic distribution.

VirtualBox Multiboot USB

Send to Kindle

Yesterday, I wrote about paying for free software. At the very end of that post, I highlighted a program called Macrium Reflect. That program can automatically create a Linux-based Rescue CD (in order to restore a previously saved image to a damaged or new hard drive).

On their site, they have a good tutorial for how to put that rescue ISO on a USB drive. As long as your BIOS supports booting from the USB drive (most modern ones do), it’s a tad more convenient to carry around a flash (thumb) drive than a CD.

In that tutorial, they use a program called UNetbootin (Universal Netboot Installer). What’s cool about this program (free and open source as well) is it can take practically any ISO and create a bootable USB drive out of it. It has many other cool features (e.g., it can automatically download any number of Linux distros and create a bootable USB or CD without you even knowing the location of the Linux project website!).

UNetbootin uses SysLinux under the covers to create and manage the bootable USB drive. Within SysLinux, there is a single file, syslinux.cfg, which controls the menu of selections that can be booted (different kernels, options to pass to a kernel, etc.).

Now switching gears for a moment, then back to the above to tie it all together…

There are a number of high-quality Virtual Machine programs/products available for all of the major operating systems. The three biggies on Windows are VMware, Virtual PC (directly from Microsoft) and VirtualBox (from Sun). All three are very capable, and all three have at least one version that is completely free.

On my old XP laptop, I used to use VMware Player. It’s free and quite good. I have read that recent versions of Virtual PC are good as well (also free), but I’ve never bothered to install it. While I understand that you can run Linux in Virtual PC, I believe it’s not supported, and I don’t really have a need to run Windows under Windows, so I passed on checking it out.

A few months ago, I stumbled onto VirtualBox. It used to be called InnoTek in a previous incarnation, and was purchased by Sun. There is a free version, which is fully open sourced as well, and there is a proprietary version which adds a few bells and whistles (including some cool USB support), which is available in binary form for free as well (for non–commercial use).

Since I have no interest or need (or capability!) to mess with virtualization source code, I am using the full binary version. On my new Vista Ultimate x64 laptop, I have only VirtualBox installed. I didn’t even download VMware (no knock on their product whatsoever!).

Here is what I like about it. Very fast to load. Full 64 bit support (both their app and guest operating systems!). Virtual PC now has 64 bit support for their own application, but you can only run 32 bit guests (if I understand correctly). Most importantly, I like the fact that it’s more complete (or at least easier to use) than the free version of VMware. I’m way too casual a user (I can go months without launching a VM!) to be willing to pay for VMware Workstation.

So, here are my two normal use cases with VirtualBox, and why I rarely need to run it:

  • Check whether a new Rescue ISO works
  • Do something fancy with ssh and X-Windows

The first one is simple. For emergency purposes, I carry around a few Linux Rescue disks (used to be only CDs, but stay tuned). My current favorite is SystemRescueCD (currently in version 1.1.4). When a new version becomes available, I download, and boot it immediately in VirtualBox, make sure it seems to work correctly, and only then burn it to a CD and toss the old CD.

The second is rarer, but more complicated. On rare occasion, a friend of mine who is running Linux (that I set up for her) on a very old laptop (that I gave to her) has a problem that I can’t talk her through over the phone. When that happens, I fire up CDLinux under VirtualBox, do some port forwarding on my router, do some ssh magic, and take control of her machine (by allowing her to ssh into my box first, so I don’t have to make changes on her firewall!). I can then even run GUI apps from her machine, redirecting the X session back to me!

Anyway, the point is that VirtualBox works really well, has tons of knobs (we’ll get to one of them in a minute), and doesn’t seem to slow down my pretty darn fast system.

Back to our main story…

When I created the Macrium Reflect Rescue CD (burned to a real CD), I also followed the tutorial to creat a bootable USB disk. When I looked at the disk, I saw the SysLinux stuff, and noticed that all of the Macrium files were in a folder.

I then experimented by using UNetbootin to create another bootable USB disk with SystemRescueCD on it. I saw that it used a different directory to store the various Linux kernels that it can boot. I was able to copy that directory to the other USB disk and copy/paste the lines from the syslinux.cfg file on the SystemRescueCD drive into the other syslinux.cfg.

I did the same thing with CDLinux (version 0.9.0 Community Edition). It used the same name for its subdirectory as Macrium did. I renamed the subdirectory before copying it over, and used the new name in the merged syslinux.cfg file. That worked, because once SysLinux gives control to the kernel in the renamed directory, everything else is relative to that new root directory!

I then rebooted my machine to test the new USB disk. It booted perfectly, and I had 28 choices of kernels to boot from! SystemRescueCD offers most of them, but I had Macrium Reflect and a few flavors of CDLinux to choose from as well. I was able to boot both 64 bit and 32 bit versions of SystemRescueCD successfully. Awesome.

Now the big test. I wanted to see whether I could boot that USB disk from VirtualBox. That would allow my normal use case of testing new releases without having to burn and reboot. Unfortunately, the GUI for VirtualBox does not permit an actual hard disk (USB or otherwise) to be directly attached to the VM (at least not for direct booting).

A quick scan of their excellent manual gave me the answer. There is a command line administration tool called VBoxManage.exe that can be used to create a tiny virtual disk (a VMDK file) that essentially points to any real disk or partition. I used that to create this virtual pointer to my USB drive. It worked perfectly.

I then attached that tiny VMDK disk to my virtual machine and fired it up. Voila, I got the same 28 choices to boot from. I couldn’t get the 64 bit versions to work (they boot, but they claim to be missing modules and won’t start X-Windows), but everything else works flawlessly under VirtualBox.

So, now I have a multi-boot USB drive, that I can keep adding stuff to, that I can test under VirtualBox to be sure it will work correctly should I ever have an emergency. It’s a 1GB USB drive, that has all of these various operating systems and tools on it, and I still have 500MB free. πŸ™‚