A VPS in the Home/Office

If a VMWare Server/Workstation or VMWare Player make life easy when mixing Linux and Windows on a single system, then a VPS will wipe the floor with them if you need to run several Linux environments and are not worried about high end graphics.

Usually, a VPS (Virtual Private Server) is offered by web hosting companies to their customers as an alternative to virtual hosting (where they can upload web pages and applications, but not configure the server software) and Dedicated Hosting (Where they get – and pay for – an entire server that they can specify and manage themselves).  Like Virtual Machines on a Workstation, a VPS on a server allows the hosting supplier to slice up one big server into many smaller servers, each with their own operating system, RAM and Hard Disk space.

Now, on one of these hosted VPS machines, you get enough resources to run a few web services accross one or more domains – depending on your budget.  The operating systems are pre-installed with the minimum software required, its up to you to add more – but its best to stick with the minimum you need for reasons of performance and security.

Move that same VPS system onto your own server connected to your workstation with a 100Mb network behind a properly setup router/fire wall and things are very different.

You can slice up your server however you need, I’m using a recent single core machine with 3 Gb RAM and a couple of 80 Gb SATA Hard Drives raided together.  At the moment, a 110Gb Drive is also sitting on the IDE connector.  It currently has seven containers running, the smallest has 900Mb ram and 6Gb of Hard Drive Space and is a bit of an overkill running DNS to the rest of the network as it does.

The Largest has 3Gb RAM, 26Gb of Main Hard Disk and exclusive access to the 110Gb IDE drive.  This is my ‘Desktop’ system.  It runs VNCServer, creating a virtual desktop that I can log into from wherever I happen to be sitting, an Ubuntu 8 Server operating system with the addition of XFCE desktop (compiled from source rather than the Ubuntu packages), Firefox web browsing, Gftp, Thunderbird for email, Open Office for general documents, PDF Viewer etc.  Also running in this container is Samba, so that I can share any files with the windows machines I now use to access the system.

In order to run server software like Samba, that requires a little more access to the networ card than usual, the OpenVZ vethN device is used, this requires that a script is run on the server after the container has started.  As I don’t often need to restart the server or the desktop container very often, I run this from a SSH login.

Regular server software such as Apache, sshd and even VNC Server are quite happy with the regular ‘venetX’ devices that start whenever a container is started.

The VPS Software running all this is OpenVZ.  It has command line tools for creating and modifying  ’containers’ and there are several templates for various distributions of linux, or you can create your own.

On top of this, there is a great browser based tool for managing the server, VTONF is GPL software from a hosting company called Bobcares.  It allows you to completely run the VPS Server using a browser, creating, starting, stopping and modifying containers at the click of a button.

So, How is this any better than a Virtual Machine running on a server?

Well, as the only software running as some version or other of Linux, OpenVZ is able to keep all of the container file spaces under a single directory “/vz” on the main system.  To inspect or retrieve some files, from a container, you just need to navigate to the relevant directory under “/vz”.

If a container is going to need more space that you planned for, VTONF (or a shell command) will allow you to increase it.  Ditto for memory.

Unlike a VPS up at a web host, your VPS Server can be asked to map any physical device ( in the ‘/dev’ directory) can be mapped to a container.

I recently found another advantage.  As the file system inside an OpenVZ container is simply a complete linux system root, should you need to use it on another linux system, it can be copied to a drive or memory stick and then, it is just a matter of ‘mount -bind’ing then ‘/dev’ and ‘/proc’ directories before chrooting into the container root.

I did this with an EeePC and the Container I use to do a bit of PHP developement.  A couple of changes in the container’s ‘/etc’ folder – to deal with the different network settings – and I was able to start the container’s apache webserver and log into the content management system using the EeePC web browser pointed at “http://localhost” .

This entry was posted in Computing, Eee PC and tagged , , . Bookmark the permalink.

Comments are closed.