So, I wanted to see how far I could get with installing something which is a tad obscure onto an otherwise Linux only VM host. So, why not use FreeBSD? My goal here was to deploy a FreeBSD server to Linode (aka Linux Node IIRC) and see if it could boot, if I could get SSH access to more verify if I can actually use it as a viable VM.
Now, I have been a long-term customer of Linode and also have a few servers with them – if you’d like to try them out then use this link to signup, it’ll help me out!
Anyway, essentially I followed this guide on Linode Guides, but it mentioned Linux? What if I don’t want Linux? Windows? Well, Windows is boring and not as entertaining to set up. So, I am sitting here thinking “hmm, there is nothing on Netflix I want to watch, I have a little bit of a hunger and maybe, I want to do something a little strange” like the person I am. So essentially, I wanted to play around with FreeBSD except running it in Virtualbox isn’t as fun… I wanted to remotely install it (or in this case boot it) somewhere where it wasn’t supposed to be installed. Sure, I could go with a FreeBSD VPS provider but again it takes away the fun of setting up a complete system yourself.
So, I’ve got a few VPS servers with Linode and thought there really isn’t any reason why it couldn’t boot… Assuming I boot it up into a recovery distro and just DD the drive with my FreeBSD image.. Right? Well, we’ll see. I thought I’d write this as I am doing the installation process for teh lulz. So, since I have a pretty-quick 200/200Mbit UFB connection provided by the ever-awesome folks at BigPipe I should be able to do this before I get to bed (here is hoping) so lets start by grabbing the FreeBSD ISO and installing this sucker on a VM. I am using in this configuration a VM with 1gb of ram, and a single processor hoping to match the $10US plan that Linode have as close as possible. The annoying thing though is because I crave the latest and greatest my FreeBSD download is running at around 10Mbit (boooo!) because I have to use their US servers and I am based out in the middle of New Zealand (literally… Well, close enough).
I really have no need for another virtual machine as I am sitting on plenty due to running a home OpenVZ server (soon to be upgraded with Linux Containers because OpenVZ is very last century) so this is literally going to be a task to create a FreeBSD machine, set it up with basic SSH access and firewalling, move it to Linode and hopefully boot it.
So, after setting up your FreeBSD machine it is time to configure this bugger… Create a new VM in Linode with the following configuration settings (I love how it quotes I am doing something weird here):
Now, boot into the Finnix rescue environment on Linode and enable SSH – I’ve created a storage partition (/dev/sdb) for the temporary storage of the FreeBSD image (mounted at /mnt/storage on Finnix @ Linode). Then, boot your Virtualbox VM into Finnix (am just using a ramdisk for this task) and create an image of /dev/sda with “dd if=/dev/sda of=/tmp/image.img bs=1024” and SCP this to your Linode host:
Now is the time to make some Noodles (or Ramen for almost everyone else), sit back and wait for the upload to finish. Depending on your upload speed you could cook a full meal in this time however with my upload (as you can see) Noodles is all I have time for…
Now, once it is copied to your Linode you want to DD this sucker to your /dev/sda disk:
So, it worked… Now, let’s SSH into this sucker.
I literally can’t even… I think it is time for bed. This was easier than I thought (everything, including IPv6 networking is working out of the box). Now, I did install Hiawatha + WordPress on this VM to test performance and it was surprisingly quick so it is a somewhat viable solution if you’re wanting FreeBSD in the cloud, or to run a FreeBSD Firewall like PFSense in front of your Linode hosts (maybe for a private cloud situation). Thanks Linode for making an excellent solution!
Edit after the fact: I just found this guide on Linode Guides that has another way to install FreeBSD on a Linode. I more wanted to experiment with creating a whole disk image and uploading it for an operating system that doesn’t have a standard Linux partition and is pre-configured (as in this case where I pre-configured a FreeBSD machine and uploaded it + booted it in the cloud).