HostOnNet Blog

HOW-TO: Virtual Dedicated Server

Virtual Dedicated Server

A software that allows you to partition a physical server into several “virtual” servers which give complete root access and a share of the physical host’s CPU and memory resources.

User Mode Linux (UML) is just one way of doing VDS/VPS.

HOW-TO

This is a quick way of setting up a VDS. We will use the Kernel: 2.4.22-8um in this. You can use any you want.

First of all, make a UML directory on the server with the following command in SSH

mkdir /uml/

Then, we need to change to the newly made directory, using the following command:

cd /uml

Then, Download the kernel via shell with the following command:

wget http://kernels.usermodelinux.org/kernels/linux-2.4.22-8um/linux

Once the Kernel (roughly 2.5MB) is downloaded, execute the following CHMOD:

chmod +x /uml/linux

At this point, the kernel is in a runnable state, but we havent got any OS to boot into, or any tools to run the UML properly!

So, next we will download the uml tools, and install them. To download them, in shell, type the following command:

wget http://nrh-up2date.org/howto/uml/packages/host/uml_utilities-20030903-1.i386.rpm

Now, we need to install these utilities with the following command:

rpm -i ./uml_utilities-20030903-1.i386.rpm

After this installtion, we are nearlly done, but we need one more item, the OS!

For this tutorial, we will just grab a copy of the Redhat OS from the UML site, so you need to type the following into shell:

wget http://aleron.dl.sourceforge.net/sourceforge/user-mode-linux/root_fs.rh-7.2-full.pristine.20020312.bz2%3Cbr%20/%3E

Once this is downloaded, simply type the following to un bzip it:

unbzip2 ./root_fs.rh-7.2-full.pristine.20020312.bz2

This will take a while to unbzip. Once it is done, we will make a test vds to ensure all is working, so we will do the following commands:

adduser vds1
passwd vds1 myfirstvds

This will add a user named: vds1 with the password: myfirstvds.

Now, we will make the UML run under that users login, so we type the following in order:
quote:

cp ./root_fs.rh-7.2-full.pristine.20020312 /home/vds1/root_fs
cp ./linux /home/vds1/linux

This will cause the files “root_fs.rh-7.2-full.pristine.20020312(which will now be named “root_fs”)” and “linux” to be in the user “vds1” directory. Now, we will CHOWN it to user “vds1” so that the user can run it.

chown vds1 /home/vds1/linux
chown vds1 /home/vds1/root_fs

Now, at this point we have a VERY basic VDS setup. So, we will run it with the following command line to test if it works:

/home/vds1/linux ubd0=root_fs root=/dev/ubd0 mem=128m

The above line says: Boot the linux kernel, and the OS is in root_fs and make 128MB of ram available to the UML.

This should boot the VDS up to a running state.

More Info

http://user-mode-linux.sf.net/


Posted in Uncategorized. Bookmark the permalink.