Install a Custom Distribution on a Xen Linode
Updated by Linode Written by Linode
DeprecatedThis guide has been deprecated and is no longer being maintained.
If you’d like to run a Linux distribution on your Linode that isn’t available from our distribution list, you can do so by following these instructions. This guide is handy for people who prefer distributions that aren’t heavily used in the community, or for those interested in creating a highly customized Linux environment and porting it to their Linode.
NoteThis guide is intended for Linodes using our older Xen hypervisor. To install a custom distribution on a new KVM Linode, see this guide.
Creating the Virtual Machine
We’ll use a free virtualization suite called VirtualBox to install a Linux distribution locally, but you can also use another virtualization package, such as VMware or Parallels. If you already have a Linux virtual machine that you’d like to run on your Linode, skip to Booting the Virtual Machine with Finnix .
NoteWe’re using Ubuntu 12.04 as the guest operating system in this guide, but you can install virtually any Linux distribution.
Here’s how to get started:
Launch the VirtualBox application. The window shown below appears.
Click the New button to create a new virtual machine on your personal computer. The window shown below appears.
In the Name field, enter a name for the virtual machine.
Select Linux from the Type menu, and select your Linux distribution from the Version menu.
Click Continue. The window shown below appears.
Select the amount of RAM that will be allocated to the virtual machine on your personal computer. This value should match the amount of RAM provided by your Linode plan.
Click Continue. The window shown below appears.
Select Create a virtual hard drive now and then click Continue. The window shown below appears.
Select VDI (VirtualBox Disk) and then click Continue. The window shown below appears.
Select Fixed size and then click Continue. The window shown below appears.
Enter a name for the hard drive, and then select a size for the virtual machine’s hard disk. You’ll want to create a hard disk just a bit larger than will be necessary to hold your installed Linux distribution.
Click Create. It may take a minute or so for the hard disk to be created. After it’s created, the window shown below appears.
Click Settings, and then click Storage. The window shown below appears.
From the Storage Tree window, select the Empty option under Controller: IDE.
Click the CD icon, and then select Choose a virtual CD/DVD disk file.
Select your Linux distribution install image, and then click Open.
Note
If you haven’t already downloaded the image of the Linux distribution to your desktop computer, do that now.Click Network. The window shown below appears.
From the Attached to menu, select Bridged Adapter. This setting will allow your virtual machine to be reached from anywhere on the local network.
Click OK.
You should see the Oracle VM VirtualBox Manager window again. Click Start to turn on the virtual machine.
Follow the distribution’s installation instructions. When prompted to partition the disk, create a single partition for
/
and a small partition forswap
, as shown below.Note
You will need to ensure that your distribution’s installer configures your partitions without LVM (Logical Volume Management), as disks created with LVM cannot be transferred to your Linode.Select the packages you’d like installed on your server, such as OpenSSH server for easy remote administration, as shown below.
Complete the installation, and then shut down the virtual machine.
You have successfully created the virtual machine.
Booting the Virtual Machine with Finnix
Now you need to boot the virtual machine with Finnix to transfer it to your Linode. Here’s how to boot the virtual machine with Finnix:
- Download the latest Finnix ISO image from finnix.org. You’ll use this image to boot the virtual machine and then transfer the virtual hard disks to your Linode.
In the Oracle VM VirtualBox Manager window, click Settings, and then click Storage. The window shown below appears.
Click the CD icon, and then select Choose a virtual CD/DVD disk file.
Select your Linux distribution install image, and then click Open.
Click OK.
You should see the Oracle VM VirtualBox Manager window again. Click Start to turn on the virtual machine.
The virtual machine is now ready to be transferred to your Linode.
Migrating the Virtual Machine to Your Linode
Above, you created a virtual machine and prepared it for transfer to your Linode. The steps below will walk you through configuring a Linode for your custom image. In this how-to, we will start with a new Linode. However, the information provided can be applied to existing Linodes by adding new disks.
Setting up your Configuration Profile
Start from the Linode Manager by configuring a Linode to boot your custom image.
Log in to the Linode Manager.
From the Linodes tab, select the Add a Linode option, which is located to the right of the page under your list of Linodes.
Select your plan and Linode location, then click Add this Linode!
Select the recently created Linode from the Linodes tab Linodes list.
Optionally, select Settings and change the Linode Label to Custom_Distro or similar. Then select Save Changes.
Select the newly labelled Custom_Distro Linode.
Select Create a new Disk. Label the new disk to “Custom_Distro” or similar. Select the Type as ext4. Ensure that the Size of the disk is at least as large as the fixed size of the virtual machine disk running on your local machine. In Step 10 of the Creating the Virtual Machine section, we pictured the disk size as 3.00 GB or 3,000 MB. Continue with this size. Select Save Changes.
Now create the swap disk. Again, select Create a new Disk. This time set the Label as “Swap”. Set the Type as swap. Finally, set the size to 256 MB or larger.
Next, create a configuration profile for the Linode by selecting Create a new Configuration Profile. Change the Label to “Custom_Distro” or similar. Under Block Device Assignment change /dev/xvda to Custom_Distro and /dev/xvdb to Swap. Notice that root device is set to Standard: /dev/xvda making the Custom_Distro disk the boot device. Warning, do not change the root device setting.
Select Save Changes.
Next, select the Rescue sub-tab, which is located on the same row as the Dashboard tab. Select Reboot into Rescue Mode. Monitor the Host Job Queue progress bar for the system shutdown and the system boot. It should take under a minute.
Once your Linode has booted into Finnix Rescue Mode, you should be able to connect to it via the Lish Console.
Starting SSH in Finnix
In order to transfer the disks from the virtual machine to the Linode, you will need to start SSH on the Linode itself.
Set the password for Finnix’s root user by issuing the following command:
passwd
Start the SSH service by entering the following command:
service ssh start
Mount your Custom_Distro disk by entering the following command:
mount /media/xvda
Copying the Disk from VirtualBox to your Linode
The steps below will walk you through transferring your new disk from your local Virtual Machine to your Linode.
Mount your local disk by entering the following command at the prompt on your local virtual machine:
mount /media/sda1
Note
/media/sda1 is typically where the disk lives, but it may be in a different directory path or filename depending on your configuration.Enter the command below to copy your disk to your Linode. Make sure to replace
12.34.56.78
with the IP address of your destination Linode:rsync -avz /media/sda1/ root@12.34.56.78:/media/xvda/
Note
You can monitor the progress of your transfer by running the following command at the Lish prompt on your Linode.
watch df -h
Once the rsync file transfer has completed, go back to your Lish console. Edit the /etc/fstab file by running the following command:
nano /media/xvda/etc/fstab
Modify the file to match the following:
- /media/xvda/etc/fstab
-
1 2 3 4 5 6 7 8 9
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). #<file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/xvda / ext4 noatime,errors=remount-ro 0 1 /dev/xvdb none swap sw 0 0
Exit and save the file by pressing
Ctrl+x
, typey
to save your changes, and pressenter
to exit.
The disk has been transferred to your Linode. You should now be able to boot your Linode normally and log in via SSH. Remember to use the username and password created during step 23 under the Creating the Virtual Machine heading. Also, check your network configuration and if necessary refer to the Linux Static IP Configuration guide.
Congratulations, you have successfully transferred the custom distro disk from your local virtual machine to your Linode.
Join our Community
Find answers, ask questions, and help others.
This guide is published under a CC BY-ND 4.0 license.