1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Saving money on dedicated Windows servers with VirtualBox

Discussion in 'Making Money' started by azxten, Oct 1, 2009.

  1. azxten

    azxten Junior Member

    Joined:
    Mar 6, 2009
    Messages:
    143
    Likes Received:
    109
    I'm not sure if this belongs in making money but it's the closest thing I could think of since it's about saving money. A penny saved is a penny earned, right? ;)

    Anyway, this is a quick and simple guide to using VirtualBox on a dedicated Linux server to get a Windows OS running. This will save you around $20+ a month if you're paying/going to pay for a Windows license from your host.

    The first thing you need to do is grab a copy of VirtualBox for your particular distribution of Linux. I did all of this with CentOS 5 so I know that works with these steps but it should work with any popular distribution.

    http://www.virtualbox.org/wiki/Downloads

    Now let's get that RPM installed...

    Next you'll need to install the kernel-devel package with...

    Now that you've installed this package you'll be able to finish the VirtualBox setup which probably told you about a failure to compile or some shit when you installed the RPM. Use the following command to redo the setup...

    If this fails and you check the install log and it says...

    "Makefile:147: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop."

    ...it's because your kernel-devel and kernel aren't working together right due to version differences (or was in my case). Run...

    ...then repeat the vboxdrv setup command above. If it fails again reboot your server and try again as your kernel updates might not have gone through.

    Now, run the following command to add yourself to the vboxusers group and and setup the proper permissions...

    Now you're all done. VirtualBox is installed but obviously you won't be using the GUI (or at least I hope you aren't using a GUI on your dedicated server).

    Time to setup your virtual box from the command line instead. Run each of these commands one after another. Hopefully all the parameters are obvious but just in case name is the name of your virtual box. Memory is how many megabytes of RAM you want it to use. Boot1 will be the first boot device. Nic1 specifies NAT (could be bridged, etc). Filename will be your "hard drive" filename. Size is your "hard drive" size in megabytes. HDA is the primary hard drive, note it's just the name you made before. DVD is the ISO it will use when booted for the first time. If you want to mess with these settings more just look in the VirtualBox manual.

    Now you can start your VirtualBox with...

    This will create a background process for your VirtualBox.

    You should be able to connect to your dedicated server IP with a remote desktop client and see your new Windows box. This is using VRDP with a virtual remote desktop connection not the built in Windows remote desktop stuff. However, you can connect with the Windows remote desktop tool. Just the server end is kind of "emulating" it. This allows you to setup your OS and such before remote desktop has been enabled in Windows.

    Stop your VirtualBox with...

    Hope this saves some people some money.
     
    • Thanks Thanks x 3
  2. golum

    golum Registered Member

    Joined:
    Dec 6, 2006
    Messages:
    73
    Likes Received:
    4
    Nice tutorial. :)
     
  3. insider

    insider Regular Member

    Joined:
    Jul 5, 2009
    Messages:
    344
    Likes Received:
    134
    Location:
    Europe
    Very useful mate thanks. If I'm short on budget and can only rent one dedicated server, is this a bad idea to do this on the server I use to host my websites, if I get one dedicated IP for the windows VM ? Is there a risk of crashing the server or something ?
     
  4. azxten

    azxten Junior Member

    Joined:
    Mar 6, 2009
    Messages:
    143
    Likes Received:
    109
    ^^ Nope, no risk at all. Uses a different port.
     
  5. balazs700

    balazs700 Registered Member

    Joined:
    Mar 3, 2010
    Messages:
    58
    Likes Received:
    13
    Location:
    exactly there
    what? it's funny... who wants to run a windows on linux? actually it's total stupid... if you virtualize a windows you still have to pay for license... in that case you have to pay and not your hosting provider... and what about the server power management.... windows need more powerfull hardware than a linux.... so this is def stupid idea
     
  6. savvypro

    savvypro Regular Member

    Joined:
    Jan 14, 2010
    Messages:
    211
    Likes Received:
    133
    It depends on the version of Windows you use, as well as what you plan on using the virtual machine for.

    Vista and 7 are a no no, as they really need resources and lots of space just for the basic install. XP would be the version to use.