This guide is specifically for setting up Hyper-V Replica between two Windows 2012 (not Windows 2012 R2) servers in Workgroup mode (not joined to a domain) using SSL/HTTPS over port 443 (not PLAIN/HTTP over port 80) and focuses on the configuration of the SSL certificates.

Note: PrimaryServer is the server with the VM that we want to replicate. SecondaryServer is the server that will host the replica of the VM.

  1. Disable Windows Firewall on both servers (or at least allow port 80 and port 443 inbound on both servers)
  2. Make sure the user account you are setting up Hyper-V replica as, exists as member of the Administrators group on both servers, with the same password!
    1. For simplicity sake, you could use the Administrator account, with the same password on both servers.
  3. Add entries to the c:windowssystem32driversetchosts file as follows
    1. IP-Address Hostname. For example:
      1. 192.168.1.1 PrimaryServer
      2. 192.168.1.2 SecondaryServer
    2. Do this step on both servers. You should be able to ping both hostnames from both servers without using an IP Address (using the hostname instead).
  4. Download MakeCert on to both machines. You can download it here.
  5. Open a command prompt on the PrimaryServer (not powershell) and run the following commands in the makecert directory
    1. makecert -pe -n "CN=PrimaryServerRootCA" -ss root -sr LocalMachine -sky signature -r "PrimaryServerRootCA.cer"
    2. makecert -pe -n "CN=PrimaryServerHostName" -ss my -sr LocalMachine -sky exchange -eku 1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2 -in "PrimaryServerRootCA" -is root -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 PrimaryServer.cer
  6. Open a command prompt on the SecondaryServer (not powershell) and run the following commands in the makecert directory
    1. makecert -pe -n "CN=SecondaryServerRootCA" -ss root -sr LocalMachine -sky signature -r "SecondaryServerRootCA.cer"
    2. makecert -pe -n "CN=SecondaryServerHostName" -ss my -sr LocalMachine -sky exchange -eku 1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2 -in "SecondaryServerRootCA" -is root -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 SecondaryServer.cer
  7. Copy the PrimaryServerRootCA.cer file from the makecert directory on the PrimaryServer to the makecert directory on the SecondaryServer
  8. Copy the SecondaryServerRootCA.cer file from the makecert directory on the SecondaryServer to the makecert directory on the PrimaryServer
  9. Open a command prompt on the PrimaryServer (not powershell) and run the following commands in the makecert directory
    1. certutil -addstore -f Root "SecondaryServerRootCA.cer"
    2. reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
    3. reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationFailoverReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
  10. Open a command prompt on the SecondaryServer (not powershell) and run the following commands in the makecert directory
    1. certutil -addstore -f Root "PrimaryServerRootCA.cer"
    2. reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
    3. reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationFailoverReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
  11. You can now follow the steps here: http://technet.microsoft.com/en-us/library/jj134207.aspx to set up Hyper-V Replica on Windows Server 2012 (skip over the SSL certificate stuff, you just did that). Ignore the Hyper-V Replica Broker detail. If you’re clever enough to be setting up a Hyper-V Replica Cluster with a Broker, you don’t need to be reading this guide 😉
    1. For the rest of us, proceed as follows:
      1. http://technet.microsoft.com/en-us/library/jj134153.aspx  – Prepare to Deploy Hyper-V Replica (skip sections 1.4 and 1.5).
      2. http://technet.microsoft.com/en-us/library/jj134240.aspx – Enable Replication (skip section 2.2)
      3. http://technet.microsoft.com/en-us/library/jj134165.aspx – Test the Replication Deployment
      4. http://technet.microsoft.com/en-us/library/jj134194.aspx – Perform a Planned Failover
      5. http://technet.microsoft.com/en-us/library/jj134169.aspx – Respond to an Unplanned Failover

Ever wanted to copy files from one linux server to another, via SSH? Here’s the command:

scp -P 22 -r /home/username/local-directory ip-or-hostname-of-remote-server:/home/username/remote-directory.

scp = Secure Copy.

-r = Recursive (copy the contents of the directory and the contents of any directories inside that directory).

-P = (specifying the port number).

22 = The port number SSH is running on, on the remote server. (That’s right, some of us who are little security conscious, don’t leave SSH running on port 22).

/home/username/local-directory = The local directory on the ‘source’ server, containing the files you want to copy to the remote servers

/home/username/remote-directory = The directory on the ‘destination’ server, where you want to copy the files to.

ip-or-hostname-of-remote-server = The example says it all. Replace this section with the remote IP Address or Hostname of the destination server.

Easy enough? If not, or you would like further examples or assistance, please feel free to ask you questions in the comments.

The contents of this guide should work perfectly fine on a base (yes that’s base, not bare bones) only installation of either CentOS 32/64 bit or RHEL 5.3 32/64 bit. If you have any troubles, please do leave a comment and I’ll do my best to assist you. This guide assumes you are setting up your machine to be a server, although the steps will work just fine on a machine configured to be a desktop.

Install CentOS 5.3 32/64 Bit

If you haven’t installed CentOS 5.3 already, you should do so. Kinda hard to use VMware Server 1.0.9 without an operating system. Most people want the host OS to have as little additional crap as possible. In regards to that, during the installation, make a point of not installing any additional packages, or package groups except the ‘Base’ group (oh and leave the base group in it’s default state, don’t go ticking on any extras, you’ll make the installation install more dependancies thus more crap). So in other words, only the ‘Base’ group should be ticked, untick the rest!

Nope, you won’t have any GUI, and even if you did, you still have to do the rest of the configuration at the command line anyway. VMware Server 1.0.9 host with GUI = bad idea, unless of course your host is also your desktop.

Once installed, configure your host as you like it from the ‘firstboot’ screen and than login as root. Here’s a few tips.

  • Disable any services you aren’t using.
  • Disable SE Linux
  • Unless you’re going to configure and use it with VMware Server 1.0.9 machines, disable ip6tables
  • Don’t go configuring special firewall rules just yet, leave that until later.

Even though it’s the host, its’ software should still be up to date. Issue the following command and download any updates.

yum update

Updates finished? Awesome! Lets reboot the server and start the next step afresh.

shutdown -r now

Install VMware Server 1.0.9 Required Components.

Plenty of you will argue about what you do and don’t need to complete the install. Well, I’ve completed this configuration of server with VMware Server more times than I care to remember now, and sometimes I needed all of these packages and sometimes I didn’t. No, I didn’t bother to find out why. Do you know why? Great! Put it in the comments!

Login in as root and issue the following commands one after the other. Yes, you can issue them all at once if you’re clever, I like to take my time, in case the worlds explodes.

yum install kernel-devel
yum install kernel-headers
yum install libXtst*
yum install xinetd
yum install gcc*

On a couple of occasions, I needed the following package – It could have been when I was using CentOS 5.3 64Bit

yum install libXdmcp-devel
yum install libXrender*

What does the ‘*’ mean? It means grab any packages that start with ‘anytextbeforethe*’

Installed all the packages? Fantastic! Lets reboot the server and start the next step afresh.

shutdown -r now

Install VMware Server 1.0.9

How you get the installation package of VMware Server 1.0.9 onto your server is up to you. Here are a few tips.

  • Download VMware Server 1.0.9 Here or Here
  • Make sure you register for a VMware Server serial number or numbers. It’s free.
  • You can use WinSCP to transfer VMware Server 1.0.9. to your server (it uses SSH). Get it Here or Here.
  • You could use the wget command with the direct link above, directly on your server, like this:
    • wget -c http://download3.vmware.com/software/vmserver/VMware-server-1.0.9-156507.i386.rpm
  • Burn it to a CD
  • Burn it to a DVD
  • Transfer it to a USB Drive

Once you have the VMware Server 1.0.9 installation file on your server, installing is pretty straight forward. If you’ve never installed a RPM file before, pay attention, people go to university for this stuff. Make sure you are logged in as root, and issue the following:

rpm -ivh VMware-server-1.0.9-156507.i386.rpm

Easy, no?

Depending on the power of your server, it may take a few minutes to install. Once installed, we have one last final step. No need to reboot this time!

Configuring VMware Server 1.0.9

Issue the following command. If some or none of the required packages are not installed, this will tell you straight away.

vmware-config.pl

or if you are so inclined:

/usr/bin/vmware-config.pl

Both do the exact same thing. Don’t run both (either by concatenating them both together or one after the other), that would just be silly and make you leave a comment about how you ran both and got an error message.

NB: If you are told that some packages or components are missing, I suggest going back and re-issuing the ‘yum’ commands above in the section ‘Install VMware Server 1.0.9 Required Components‘. Before you issue any commands, press ctrl-c to quit the setup program and return to the command prompt.

If you see something like the following, you are good to go:

Making sure services for VMware Server are stopped.

Stopping VMware services:
   Virtual machine monitor                                 [  OK  ]

You must read and accept the End User License Agreement to continue.
Press enter to display it.

The configuration settings of VMware Server 1.0.9 is now up to you. Here are a few tips:

  • Accept the agreement, type Y or Yes and press the enter key.
  • The defaults are all fine.
  • In most cases, Bridged networking is what you are after, so say ‘No’ to host only and NAT (unless you know what they are and you are going to use them)
  • Sometimes the installation would tell me that port 902 is unavailable. This is not true. Override by typing in 902, otherwise you’ll need to remember 904 (or whatever other number you select) and type it in every time when you use the VMware Server 1.0.9 client. Not cool.
  • At the very least, choose your own location for the storage of VMware Server 1.0.9 servers. I always put mine in /home/vmware (because I have /home on a separate partition)
  • Put your Serial Key in now, rather than later.

Installation and Configuration is now complete! If you need any further help / assistance, please, feel free to leave a comment

News Flash! -:- Newer Version of This Guide based on CentOS 5.3 (32/64bit) and VMware Server 1.0.9 Available Here

So you just installed CentOS 5, as your host operating system for the latest version of VMware Server, 1.0.3. However, vmware-config.pl tells you it is missing something.

libXtst.so.6

What is libXtst.so.6? Well, to keep a long story short, libXtst.so.6 is a set of shared libraries that are used by the X Windows system. Although the term X Windows has now been deprecated in place of Xorg, the libraries are still required and still retain the same name.

To install the libraries that you require, just enter the following as root (or you could use sudo if you have it set up nicely):

yum -y install libX11-devel libXtst

Once you have those two and their dependencies installed, vmware will no longer complain about missing components, but you may come across another problem.

VMware requires GCC to be installed, so that it can compile a kernel module and run happily each day forever until the sun goes down. As root, type the following:

yum -y install gcc

OK, so now you have GCC installed. If VMware complains about how it can’t find your “C Header Files”, you may need to do the following, as root:

yum -y install kernel-headers kernel-devel

Now, some people will argue that you just need one, and not the other. In my opinion, just get both. That way when you install something else that needs the other later on, you will already have it! Besides, it’s not like you are giving up gigabytes of space, it’s just a few megabytes.

Lastly, VMware will probably look for your C Header files in the following location:

/usr/src/linux/include

Unfortunately, it won’t be there. As root, type the following:

mkdir /usr/src/linux

cd /usr/src/linux

ln -s /lib/modules/<your current running kernel>/build/include include

Run the setup one last time, and hopefully everything will be fine! Don’t forget to add your selected remote access port to your firewall!

If anyone requires any further assistance, feel free to post a comment here and let me know!

If you found this helpful or interesting, why not Digg It?