Saturday, January 31, 2009

Setting Up a SME Server Test Environment with VirtualBox on Vista

SME Server (http://www.contribs.org/) is a Linux distribution designed for the office environment, similar to Microsoft Small Business Server or the now defunct Linux based NetMax Server. SME Server is managed through a web interface and provides file and print sharing, E-mail server and web client, Firewall, Directory Services, Web hosting and other services. It is also extensible via Contribs. Contribs are software packages that are designed to add extra functionality to SME Server.

This document will explain how to setup a test network environment on Vista using Virtual Box with SME Server and Windows XP Professional guests. I chose Windows XP Professional, because that is the environment I have found that most business or educational intitutions are using. This document already assumes that VirtualBox is installed and working and that the Windows XP Professioanl guest is installed in VirtualBox.

Setting Up the SME Server Guest

Start VirtualBox and the VirtualBox application displays, as in the following figure.


Start the Virtual Machine Wizard by clicking on the New button above the left hand pane. At the Welcome dialog click on the Next button. In the VM Name and OS Type dialog, enter a name for this virtual machine and select Linux as the operating system and Linux 2.6 as the Version then click Next.



The Memory dialog is where the amount of memory is allocated to the guest operating system. The amount set here depends on the amount of memory on the host machine. A good amount to allocate to SME Server is 512Mb and to Windows XP is 1Gb, if your host machine allows. After setting the memory amount click the Next button.

The Virtual Hard Disk dialog displays next. To create a new virtual disk for this guest operating system, click on the New... button. The Create New Virtual Disk Wizard now displays. At the welcome screen click on Next. In the Hard Disk Storage Type select the Dynamically expanding storage radio button, under the Storage Type and click Next. This choice will allocate disk space for the guest, but will expand to the maximum specified size as needed. This choice is also faster to create than the Fixed-size storage.



The next step is to specify the size of the virtual disk. The size to set here is a best guess estimate of the operating system and any Contribs that will be installed. This will also depend on the disk size of the host operating system and the amount that can be allocated. If there is sufficient space 20Gb is a good starting point for the test environment.



After specifying the size, click on the Next button and then the Finish button in the Summary dialog. Returning to the Virtual Hard Disk dialog, click Next then the Finish button in the resulting Summary. Now the virtual machine has been created and displays in the left pane of VirtualBox.



The next step is to specify the CDROM, or in this case, the ISO file to boot from. A bootable CD is not required, VirtualBox can boot directly from the downloaded ISO file. Using the ISO file to install is much faster than using a CDROM drive. Click on either the yellow settings icon above the left pane or the CD/DVD-ROM text in the right hand pane to display the CDROM settings. Click the check box Mount CD/DVD Drive to put a check mark. Then select the radio button ISO Image File, then the yellow and green folder icon.



In the Virtual Media Manager dialog click on the Add icon and navigate to the SME Server ISO image and select it. After selecting the ISO image click the Select button. This returns back to the SME Server - Settings.



The Test Environment Network

A little explanation of the network setup is needed here. VirtualBox has several ways to setup networking, the two we are concerned about here is a NAT (Network Address Translation) network and an internal network. NAT acts as a normal NAT network does. A system sits behind a routing device, which could be a router or firewall, using the IP of the routing device to communicate with the outside world. The second type of network is an internal network. The internal network allows guest operating systems to communicate with each other, but is isolated from the outside world.

SME Server can act as a routing device, and this will be simulated in our test environment as well as letting our test environment access the outside world. By default the eth0 device (the first network interface) will face the internal network and the eth1 device will face the outside world or Internet. To setup the network click on the Network settings in the left pane of the SME Server - Settings dialog. In tab Adapter 1 verify the Enable Network Adapter check box has a check. In the Adapter Type drop down, select Intel PRO/1000 MT Desktop. In the Attached to drop down, select Internal Network. In the Network Name text box, enter a name for the internal network, e.g. TestLAN. The name entered here will also be used with the Windows XP Pro settings, so the SME Server and XP workstation are on the same internal network.



Select the Adapter 2 tab and once again from the drop down box, select the Intel PRO/1000 MT Desktop as the Adapter Type. In the Attached To dropdown box, select NAT. Now the second network adapter is setup as the outside world/Internet/insecure side.



Click on OK to complete the configuration and settings for the SME Server guest operating sysytem. One last step before the installation begins is to set the boot order of the virtual devices. In the settings for the guest, select General and then the Advanced tab. Set the boot order by selecting the device and the up or down arrows. We are now able to install SME Server.



Installing SME Server

To begin the installation, click on the Start icon, the green arrow in VirtualBox. A BIOS type boot screen appears. You have the option of pressing the F12 key to select the boot device, since no operating system is installed the mounted ISO will boot



At the SME Server screen boot prompt, press the ENTER key to begin the installation. The resulting screen will allow you to test the CD media. Press the TAB to select Skip and press the ENTER key to advance to the next screen. The language selection screen appears, select English and advance to the next screen. In the Keyboard Selection select us and advance to the next screen. Formatting takes place next, press TAB to select Yes and advance. In the Time Zone Selection screen, select your time zone and advance. Now the installation begins by formatting the virtual disk and installing the SME Server packages. After completing the Complete screen appers, press ENTER to reboot the virtual machine.









Completing the SME Server Installation


After the reboot, configuration of the SME Server begins. The first screen asks if you want to restore from backup. Since this is our first installation, select No. In the next screen the administrator password is set. As a best practice, use a strong password with upper and lower case letters, numbers and special characters. Strong passwords is enabled by default and the installation will prompt you if the password isn't strong enough. After setting the password the installation prompts for verification.



In the next installation screen, enter the primary domain name. Since this is a test environment and the server will not provide services to or from the internet, the local top level domain is a good choice. In this example testlan.local is used.



Following the domain name is the server name, again use something logical for the test domain, in this example serv01. After the server name is the IP address of the server, use a non-internet routable IP, e.g. 192.168.1.1. After the IP address is set, the netmask value is prompted for, the default should be sufficient.

The Operation Mode of the SME Server is set next. SME Server can provide gateway services and internet services, or it can act in a standalone manner with or without gateway services. In this test environment we are testing both Internet services and gateway services, option 1, Server and Gateway is selected.



The next screen asks if the servers Internet facing network interface is a dedicated always on connection or a dial-up connection. Select option 1, Server and Gateway - dedicated and proceed to the next screen. The Ethernet card assignment screen prompts to assign each network interface. Since the virtual machine was set earlier to have eth0 face the internal network and eth1 face the Internet, option normal should be selected here.



After setting the ethernet card assignment, the internet facing network card is configured. Since VirtualBox will assign an internal IP address through DHCP, the Use DHCP option 2 should be selected. VirtualBox sets the virtual machine to use NAT and the virtual machine is "firewalled" from being accessed, but the guest can access internet services. The SME Server as configured will act as a gateway in which the Windows XP Pro client can also access external services.



The next screen prompts for use of Dynamic DNS Service. Since we are in a test environment, Dynamic DNS is not required. Select option 1, not to use Dynamic DNS. The next three screens set up the DHCP service that SME Server will be providing on the internal network side. Enable the DHCP service and set the beginning and ending IP address that the DHCP server will be assigning. Skip the Corporate DNS server address setting by selecting Next. The last step is to activate the settings, at the Activate configuration changes, select Yes to finalize the setup of SME Server.



After the settings are activated the SME Server will display a login screen. Two accounts are setup, the admin account and the root or super user account. The password is the same for both accounts that was setup earlier.



The root account is like any other Linux root account, where the command line is used to manage the server. However, the web interface is where the SME Server is maintained a majority of the time. When the admin account is used to login at the console, the server console menu is displayed.



There are a minimum amount of tasks that can be performed at the SME Server console menu. If the network is not accessible there is an option to get to the SME Server web interface, albeit with a text based web browser.

Configuring SME Server as a Domain Controller

Now that SME Server is up and running as a guest operating system, the Windows XP Pro client can be used to manage SME Server. Windows XP Professional should be installed as a guest using the same internal network as the eth0 device on the SME server. The SME Server also provices DHCP services, since VirtualBox does not supply DHCP to the internal network.

Log into the Windows XP Pro client and open a web browser to http://serv01/server-manager. Log into the SME Sever web management interface with the admin user account. From the menu on the left side of the management interface under Configuration select Workgroup. On the Change Workgroup Settings page set the name of the Windows workgroup (e.g. testlan), the Server Name and set the Workgroup and Domain Controller drop box to Yes and finally click on the Save button. After saving the settings a green Operation Status Report information box should appear. At this point reboot the server to enable the domain controller settings. (Note that I didn't try to find a way to enable these settings without rebooting the server. I will update this page if I look into this. Since this is a test environment, rebooting wasn't an issue for me.)



After the server reboots the Windows XP Pro guest can now join the domain. In Windows go to the Control Panel and start the System control panel applet to display the System Properties dialog box. In the System Properties dialog box, select the Computer Name tab, then click on the Change button. The Computer Name Changes dialog box now appears. Note that the Computer Name was set during install of Windows XP Pro. Under the Member of section, select the radio button and enter the name of the domain from the previous steps. After clicking on OK another Computer Name Changes dialog box appears, prompting for a account name and password with permissions to join the domain. Enter the admin username and password and click on OK. You will be prompted to restart the machine, click your way back through the dialog boxes and restart the Windows XP Pro guest.



After the Windows XP Pro guests restarts, a Log On to Windows dialog appears. Click on the Options>> button to expand the dialog. In the Log on to drop down, make sure that the domain name is selected and not the local workstation. Log on with the admin username and password.

Setup of our test environment is now complete. The SME Server is up and running, acting as a gateway and providing services to the local network. The Windows XP guest is getting DHCP and other services from the SME Server and is able to access the Internet. The next steps are to update the SME Server and apply all updates and anti-virus to the Windows XP Pro client.

9 comments:

Anonymous said...

Hello Sir,

Could you please tell me something?
my question is that when i finished installation SME server in Virtual box, it can't PING to the host manchin.

The Small Box Admin said...

That is correct, the guest machine cannot ping outside hosts. This is a limitation of NAT mode on VirtualBox. This is documented in the VirtualBox User Manual.

Anonymous said...

Thanks Sir for quick respond.


Last time, I used:
-Adapter Type : Intel Pro/1000MT Desktop (8254EM)
-Attached to : NAT

But it did not work, so I changed NIC to :
-Adapter Type : Intel Pro/1000MT Desktop (8254EM)
-Attached to : Host Interface

And the result is still the same last time.

P.S: I have tried with other OSs, and it is going well except SME Server.

Thanks again for helping me.
Phearoun

The Small Box Admin said...

I'm not sure what you are trying to do. Ping will not work, it is a limitation of VirtualBox. If you are trying to make it work with the Host Interface, then I have not tried to make that work.

This tutorial was meant to be XP Client <-> SME Server -> Host/Internet.

Thanks for reading,
Ken

MB said...

Thanks for this! SME Server rocks. Been running it for years.

baja mexico said...

You helped me alot. It's summer and I don't have all the classroom computers at my disposal. Now, I can have my own internal network. sme works great trying it with server2003 now

emnaz said...

Great article. I wrote how do add gnome desktop to sme server on my blog.

Gert-Jan said...

Thank you very much for this post! I am very happy with this!

John Rose said...

2 questions about my attempt at this:
I've installed SMEServer 7.5.1 in one VB machine which has ip address of 192.168.2.10, and Linux Mint Isadora 9 in another VB machine.
1. In SME Server, I did the Install Guest Additions, the iso is shown as ticked against CD/DVD Devices but it's not visible in /media/cdrom.
2. I can ping 192.168.2.10 OK from Linux Mint. But Firefox (in Linux Mint) cannot connect to https://192.168.2.10/server-manager.