VirtualBox server simulation

Instead of going straight to installing Linux on a server I want to do some test runs, just to see if everything actually works. I am not experienced enough to make any real security checks, but will try some guides I have found online for securing the server. On a virtual server I can mess up as much as I want, and just recover from an earlier snapshot if I want to revert back to where it worked.

Simple flowchart to show the process of using a virtual machine to test and troubleshoot an installation.
Simple flowchart to show the process of using a virtual machine to test and troubleshoot an installation.

Installing Debian

Naturally the first thing to install is the operating system. As mentioned I will be using Debian, and installing as few components as possible. The server hardware could probably cope with a full install, but just in case I want it as basic as possible. Any necessary bits will be installed manually if needed.

First time opening virtualbox. No virtual machines installed yet, but this will soon change.
First time opening VirtualBox. No virtual machines installed yet, but this will soon change.
I'm only choosing 2GB of RAM for the virtual machine. The real server got 8 times that, so if everything works here it should definitely work there!
I’m only choosing 2GB of RAM for the virtual machine. The real server got 8 times that, so if everything works here it should definitely work there!
The Virtualbox is set up, and ready for installing Debian.
The VirtualBox is set up, and ready for installing Debian.
The image file I downloaded from debian.org works, and I'm presented with a couple of options...
The image file I downloaded from debian.org works, and I’m presented with a couple of options…
I, being the expert here, of course select advanced options and expert install. This was never supposed to be a walk in the park.
I, being the expert here, of course select advanced options and expert install. This was never supposed to be a walk in the park.
The installer has found the image. Not sure why it had to look for it, as the installer actually booted form the exact same image. Anyway, Debian 8.6.0 is ready to install
The installer has found the image. Not sure why it had to look for it, as the installer actually booted form the exact same image. Anyway, Debian 8.6.0 is ready to install
As the server will not have a monitor connected I want to do as much as possible from a remote location, meaning my desktop computer. This gives me the option to finish the installation through SSH.
As the server will not have a monitor connected I want to do as much as possible from a remote location, meaning my desktop computer. This gives me the option to finish the installation through SSH.

Debian ready to install through SSH

Now, this is where the first little flaw showed itself. I did try this at home in a test before and everything worked fine. Debian got installed without any issues. This time however I am on a virtual machine. The IP for the Debian installer was on another subnet, and I could not connect to it through SSH. A minor setback, but I am sure I can work around it somehow. For now I have to continue the installation process from VirtualBox, and just pretend its through SSH. It looks the same anyway.

*Edit: I figured it out, check bottom of the page!*

More security? Yes, please. Whenever Linux recommends me something, I just do it.
More security? Yes, please. Whenever Linux recommends me something, I just do it.
Most of the installation is just automated stuff you have to "yes" your self through. I used default settings for most of the stuff. I did not allow root login. This is a good thing for security.
Most of the installation is just automated stuff you have to “yes” your self through. I used default settings for most of the stuff. I did not allow root login. This is a good thing for security.
I prefer kernels with a version number. I actually have no idea what the difference is here, and a quick google search didn't give me any answers.
I prefer kernels with a version number. I actually have no idea what the difference is here, and a quick google search didn’t give me any answers.
As a minimal installation I only want the necessary drivers. It says there is a small chance this wont work, but if that is the case I can always go with the other option.
As a minimal installation I only want the necessary drivers. It says there is a small chance this wont work, but if that is the case I can always go with the other option.
The minimalist thing would probably be to keep to the cd/iso. But as long as I can choose what to install I dont see the harm in using the network mirror.
The minimalist thing would probably be to keep to the cd/iso. But as long as I can choose what to install I dont see the harm in using the network mirror.
I fully support open source software, and will rarely pay for something I could get for free elsewhere. Non of the software I am planning to use is payware, so this is a no.
I fully support open source software, and will rarely pay for something I could get for free elsewhere. Non of the software I am planning to use is payware, so this is a no.
Keeping with the minimalistic trend I choose to only install the SSH server. Otherwise I don't think I would be able to connect to the server. The last option is "standard system utilities". A list of the this is can be found here. I assume all of this can be installed whenever needed, so I chose to not install them.
Keeping with the minimalistic trend I choose to only install the SSH server. Otherwise I don’t think I would be able to connect to the server. The last option is “standard system utilities”. A list of the this is can be found here. I assume all of this can be installed whenever needed, so I chose to not install them.
Installation completed. Time to see if it boots!
Installation completed. Time to see if it boots!
It boots and I can log in to my user. Time to make a snapshot of the system.
It boots and I can log in to my user. Time to make a snapshot of the system.
The Debian installation is saved as a snapshot. Whatever changes and screw ups I do now I can revert it back to the fresh install. Invaluable for test environments.
The Debian installation is saved as a snapshot. Whatever changes and screw ups I do now I can revert it back to the fresh install. Invaluable for test environments.

Thats it for installing Debian. Some trouble with the SSH connection, but that might be the office wireless network I am currently connected to. I will have to test it again on a network I control myself.

Next up is installing ownCloud. For testing I might even have to run two virtual machines in parallell. The other machine should be a Windows machine running the ownCloud desktop client, to test syncing and usability.

 

*Edit*

With some testing I figured out why I could not connect to the virtual machine through SSH. The network settings was all wrong, and it ended up on a different subnet. Using bridgemode in the virtual machines network settings gave it it’s own IP address, and I was able to connect through SSH again, and later on hopefully through a web browser as well!

The missing setting. Bridge mode gives the virtual machine a real IP address.
The missing setting. Bridge mode gives the virtual machine a real IP address.

One thought on “VirtualBox server simulation”

Leave a Reply

Your email address will not be published. Required fields are marked *