Skip to content

Commit 86ca91f

Browse files
author
Alex Fornuto
committed
Merge pull request #52 from jdooley/custom_distros
Custom distros
2 parents eff3d7b + b95fd15 commit 86ca91f

File tree

3 files changed

+107
-16
lines changed

3 files changed

+107
-16
lines changed
112 KB
Loading
153 KB
Loading

docs/tools-reference/custom-kernels-distros/running-a-custom-linux-distro-on-a-linode-vps.md

Lines changed: 107 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@
22
author:
33
name: Linode
44
5-
description: 'How to run a custom Linux distro or pre-built Linux appliance on your Linode.'
6-
keywords: 'custom distro,advanced Linux'
5+
published: 'Tuesday, August 18th, 2009'
6+
description: 'How to run a custom Linux distribution or pre-built Linux appliance on your Linode.'
7+
keywords: 'custom distro,custom distribution,advanced Linux'
78
license: '[CC BY-ND 3.0](http://creativecommons.org/licenses/by-nd/3.0/us/)'
89
alias: ['platform/custom-kernels-distros/running-a-custom-linux-distro-on-a-linode-vps/', 'custom-instances/custom-distro-howto/']
9-
modified: Friday, April 19th, 2013
1010
modified_by:
11-
name: Linode
12-
published: 'Tuesday, August 18th, 2009'
13-
title: Running a Custom Linux Distro on a Linode VPS
11+
name: Joe Dooley
12+
modified: Wednesday, October 8, 2014
13+
title: Running a Custom Linux Distribution on a Linode
1414
---
1515

16-
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 VPS.
16+
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.
1717

18-
Creating the Virtual Machine
19-
----------------------------
18+
#Creating the Virtual Machine
2019

21-
We'll use a free virtualization suite called [VirtualBox](https://www.virtualbox.org/) 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 [Set up Finnix and Copy your VM Image](#id1) .
20+
We'll use a free virtualization suite called [VirtualBox](https://www.virtualbox.org/) 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](#booting-the-virtual-machine-with-finnix) .
2221

2322
{: .note }
2423
>
@@ -70,10 +69,11 @@ Here's how to get started:
7069
15. Click the CD icon, and then select **Choose a virtual CD/DVD disk file**.
7170
16. Select your Linux distribution install image, and then click **Open**.
7271

73-
{: .note }
72+
{: .note }
7473
>
7574
> If you haven't already downloaded the image of the Linux distribution to your desktop computer, do that now.
7675
76+
7777
17. Click **Network**. The window shown below appears.
7878

7979
[![Configuring networking.](/docs/assets/1175-vbvm10.png)](/docs/assets/1175-vbvm10.png)
@@ -83,6 +83,9 @@ Here's how to get started:
8383
20. You should see the *Oracle VM VirtualBox Manager* window again. Click **Start** to turn on the virtual machine.
8484
21. Follow the distribution's installation instructions. When prompted to partition the disk, create a single partition for `/` and a small partition for `swap`, as shown below.
8585

86+
{: .note }
87+
>You will need to ensure that your distribution's installer configures your partitions without LVM (Logical Volume Management), as disk images created with LVM cannot be transferred to your Linode.
88+
8689
[![Partitioning the drive.](/docs/assets/1179-vbvm11.png)](/docs/assets/1179-vbvm11.png)
8790

8891
22. Select the packages you'd like installed on your server, such as OpenSSH server for easy remote administration, as shown below.
@@ -93,8 +96,7 @@ Here's how to get started:
9396

9497
You have successfully created the virtual machine.
9598

96-
Booting the Virtual Machine with Finnix
97-
---------------------------------------
99+
#Booting the Virtual Machine with Finnix
98100

99101
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:
100102

@@ -110,10 +112,99 @@ Now you need to boot the virtual machine with Finnix to transfer it to your Lino
110112

111113
The virtual machine is now ready to be transferred to your Linode.
112114

113-
Migrating the Virtual Machine to Your Linode
114-
--------------------------------------------
115+
#Migrating the Virtual Machine to Your Linode
116+
117+
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 disk images.
118+
119+
##Setting up your Configuration Profile
120+
121+
Start from the Linode Manager by configuring a Linode to boot your custom image.
122+
123+
1. Log in to the Linode Manager.
124+
125+
2. From the **Linodes** tab, select the **Add a Linode** option, which is located to the right of the page under your list of Linodes.
126+
127+
3. Select your plan and Linode location, then click **Add this Linode!**
128+
129+
4. Select the recently created Linode from the **Linodes** tab Linodes list.
130+
131+
5. Optionally, select **Settings** and change the **Linode Label** to Custom_Distro or similar. Then select **Save Changes**.
132+
133+
6. Select the newly labelled Custom_Distro Linode.
134+
135+
7. Select **Create a new Disk Image**. Label the new disk image to "Custom_Distro" or similar. Select the **Type** as ext4. Ensure that the **Size** of the disk image is at least as large as the **fixed size** of the virtual machine disk image running on your local machine. In Step 10 of the [Creating the Virtual Machine](#creating-the-virtual-machine) section, we pictured the disk image size as 3.00 GB or 3,000 MB. Continue with this size. Select **Save Changes**.
136+
137+
8. Now create the swap disk image. Again, select **Create a new Disk Image**. This time set the **Label** as "Swap". Set the **Type** as **swap**. Finally, set the size to 256 MB or larger.
138+
139+
9. 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 image the boot device. Warning, do not change the **root device** setting.
140+
141+
[![Configuration Profile.](/docs/assets/config-profile-small.png)](/docs/assets/config-profile-large.png)
142+
143+
10. Select **Save Changes**.
144+
145+
11. 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.
146+
147+
12. Once your Linode has booted into Finnix Rescue Mode, you should be able to connect to it via the [Lish Console](/docs/networking/using-the-linode-shell-lish/).
148+
149+
##Starting SSH in Finnix
150+
151+
In order to transfer the disk images from the virtual machine to the Linode, you will need to start SSH on the Linode itself.
152+
153+
1. Set the password for Finnix's root user by issuing the following command:
154+
155+
passwd
156+
157+
2. Start the SSH service by entering the following command:
158+
159+
service ssh start
160+
161+
3. Mount your Custom_Distro disk image by entering the following command:
162+
163+
mount /media/xvda
164+
165+
##Copying the Disk Image from VirtualBox to your Linode
166+
167+
The steps below will walk you through transferring your new disk image from your local Virtual Machine to your Linode.
168+
169+
1. Mount your local disk image by entering the following command at the prompt on your local virtual machine:
170+
171+
mount /media/sda1
172+
173+
{: .note }
174+
>
175+
> /media/sda1 is typically where the disk image lives, but it may be in a different directory path or filename depending on your configuration.
176+
177+
2. Enter the command below to copy your disk image to your Linode. Make sure to replace `12.34.56.78` with the IP address of your destination Linode:
178+
179+
rsync -avz /media/sda1/ [email protected]:/media/xvda/
180+
181+
{: .note }
182+
>You can monitor the progress of your transfer by running the following command at the Lish prompt on your Linode.
183+
>
184+
> watch df -h
185+
186+
187+
3. Once the rsync file transfer has completed, go back to your Lish console. Edit the /etc/fstab file by running the following command:
188+
189+
nano /media/xvda/etc/fstab
115190

116-
Congratulations! You've installed a custom Linux distribution and prepared it for transfer to your Linode. The next step is migrating the virtual machine to your Linode. For more information, see [Copying a Disk Image Over SSH](/docs/migration/ssh-copy).
191+
Modify the file to match the following:
117192

193+
{: .file }
194+
/media/xvda/etc/fstab
195+
: ~~~
196+
# /etc/fstab: static file system information.
197+
#
198+
# Use 'blkid' to print the universally unique identifier for a
199+
# device; this may be used with UUID= as a more robust way to name devices
200+
# that works even if disks are added and removed. See fstab(5).
201+
#<file system> <mount point> <type> <options> <dump> <pass>
202+
proc /proc proc defaults 0 0
203+
/dev/xvda / ext4 noatime,errors=remount-ro 0 1
204+
/dev/xvdb none swap sw 0 0
205+
~~~~
206+
6. Exit and save the file by pressing `Ctrl+x`, type `y` to save your changes, and press `enter` to exit.
118207

208+
The disk image has been transferred to your Linode. You should now be able to boot your Linode normally and log in [via SSH](https://www.linode.com/docs/getting-started#logging-in-for-the-first-time). Remember to use the username and password created during step 23 under the [Creating the Virtual Machine](#creating-the-virtual-machine) heading. Also, check your network configuration and if necessary refer to the [Linux Static IP Configuration](https://www.linode.com/docs/networking/linux-static-ip-configuration/) guide.
119209

210+
Congratulations, you have successfully transferred the custom distro disk image from your local virtual machine to your Linode.

0 commit comments

Comments
 (0)