VMWare Server (Host) and Guest Setup Procedure

From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search

Using VMWare Server 2 Web Interface

Important Note: To make a connection to login and use the remote console use this command: Make sure to enter this command before logging into the https://localhost:8333.

   ssh -L 8333:localhost:8333 -L 8334:localhost:8334 einstein.unh.edu

VMWare Server (Host) Setup

Important Note: In the initial setup of vmware server make sure to change the following line 2 in the /etc/vmware/config

   authd.client.port = "902"

to

   authd.client.port = "8334"

Important Note: When restarting VMWare Server 2.0 make sure to use these commands, to restart VMWare and the Web management server:

   /etc/init.d/vmware restart
   sudo /sbin/service vmware-mgmt restart

Important Note: How to make it so you can add users as administrators under the permissions tab.

  1. Stop the VMware Server host agent (at the command line, enter /etc/init.d/vmware-mgmt stop).
  2. Create a backup copy of the /etc/vmware/hostd/authorization.xml file.
  3. Open the /etc/vmware/hostd/authorization.xml file in an editor and set NextAceId to the next integer value that is not being used as as an ACEDataId. For example, if the file contains the entry setting NextAceId to 11, set NextAceId to 12.
  4. Save the updated file.
  5. Restart the host agent (at the command line, enter /etc/init.d/vmware-mgmt start).

Xen (or Physical) Host to VMWare Server Host

1. Shutdown the xen virtual machine and make a backup of the .img file. 2. Make a tarball of roentgens filesystem. This must be done as root

tar -cvf machine.tar /lib /lib64 /etc /usr /bin /sbin /var /root 

3. Set up an identical OS (CentOS 5.3) on VMWare Server. 4. Mount the location of the tarball and extract to the / Make sure to backup the original OSs /etc/ to /etc.bak/

tar -xvf machine.tar

5. Files to copy back over from the /etc.bak/

/etc/sysconfig/network-scripts/ifcfg-*
/etc/inittab
/etc/fstab
/etc/yum*
/etc/X11*

6. Turn roentgen on to prepare for rsync transfer. Make sure to shutdown all important services (httpd, mysqld, etc) 7. Log on to roentgen as root and run the following command for each folder archived above.

rsync -av --delete /src/(lib) newserver.unh.edu:/dest/(lib)>>rsync.(lib).log

Important Note: Make sure to have all the network scripts (/etc/sysconfig/network-scripts/) correctly setup, remembering:

  • Taro has two ports (UNH and Farm) and VMWare Server uses these to create two bridges (UNH-Bridge and Farm-Bridge).
  • With the two bridges on Taro you do not need VLANs setup on the guest OS in VMWare Server.

VMWare Guest Setup

Setting up VMWare Appliances

1. Download the virtual appliance. 2. Put the unpacked files in a directory accesible by VMWare Server. Note: Make sure that the preferences file (~/.vmware) in your /net/home directory has the correct permissions to run the vmware server. To change the permissions use this command:

sudo chown username:npg /net/home/username/.vmware

3. Start vmware server with this command:

sudo vmware

4. Select connect to localhost and click "Connect".

5. In vmware server click "Open a virtual machine".

6. Then "Browse" for the files (.vmx) you unpacked earlier. Now the server should be in the sidebar of the vmware server display.

7. Before starting the machine click "Edit ..." and go through the settings. Make sure to go through the setting and check for network to be set to bridge and the hard disk size. If the hard drive has to be resized you can use the vmware-vdiskmanager. If you initially setup 2 physical interfaces in the vmware server setup, only one is bridged in the virtual machine, so in the settings add a ethernet interface that is connected to the vmnetx that is bridged with the 2nd interface.

8. Check to see what devices are bridged to what:

   ps -ef |grep vmnet-bridge
     root      9267     1  0 14:34 ?        00:00:00 /usr/bin/vmnet-bridge -d /var/run/vmnet-bridge-0.pid /dev/vmnet0 eth0
     root      9275     1  0 14:34 ?        00:00:00 /usr/bin/vmnet-bridge -d /var/run/vmnet-bridge-2.pid /dev/vmnet2 eth1

Adding Swap Space without Adding a Device

1) Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):
 dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
2) Set up a Linux swap area:
 mkswap /swapfile1
3) Activate /swapfile1 swap space immediately:
 swapon /swapfile1
4) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:
 vi /etc/fstab
So next time Linux comes up after reboot, it enables the new swap file for you automatically.
Append following line:
 /swapfile1 swap swap defaults 0 0
5) How do I verify swap is activated or not?
Simply use free command:
 free -m

Adding Swap Space by Adding a Device

1) While in the VMware Guest page click "Add New Hardware" and add a new hard drive to the Virtual Machine. 2) Add the drive to the Operating System, you will want to change the y value.

 echo "scsi add-single-device 0 0 y 0" > /proc/scsi/scsi

3) Format the drive /dev/sdx using fdisk and use 82 for type

 fdisk /dev/sdx

4) Set up a Linux swap area:

 mkswap /dev/sdx

5) Activate /swapfile1 swap space immediately:

 swapon /dev/sdx

6) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:

 vi /etc/fstab

So next time Linux comes up after reboot, it enables the new swap file for you automatically. Append following line:

 /dev/sdx swap swap defaults 0 0

7) How do I verify swap is activated or not? Simply use free command:

 free -m