First we need to install everything:
  1. Installed Fusion on Mac
  2. Installed Windows and ESX as virtual machines in Fusion (root, password) Note: default password is “changeme”
  3. Installed Vsphere in Windoze
  4. Installed CentOS in VSphere
We are now ready to configure CentOS.
Configuring the Network:
Dynamic IP (you probably want a static IP – see below):
We can configure the network by using Dynamic IP address which are assigned automatically by the DHCP server.
We can now edit the interface (DO NOT CHANGE the HWADDR line in the config file):
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
NM_CONTROLLED="no"
HWADDR="08:00:27:08:47:E9"
Now, you will have to restart your network.
$ service network restart
OR
$ /etc/init.d/network restart
You should now be able to ping an external ip e.g. ping 8.8.8.8. You can also get the IP using ifconfig which will allow you to ssh instead of using the somewhat limited console in vSphere.
Static IP:
Alternatively, we can also assign the network information manually by assigning the IP Address, NETMASK , GATEWAY in the network interface config file. This is probably the best method as it allows you to ssh to an unchanging IP.
First lets confirm you gateway:
route -n
You should get a line starting with 0.0.0.0, the IP next to that is your default gateway.
We can now edit the interface (DO NOT CHANGE the HWADDR line in the config file):
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
ONBOOT="yes"
NM_CONTROLLED="no"
HWADDR="08:00:27:08:47:E9"
IPADDR=
NETMASK=255.255.255.0
GATEWAY=
DNS1=
#DNS2=
Note: Some places I looked didn’t use a DNS in /etc/sysconfig/network-scripts/ifcfg-eth0 but put it in /etc/resolv.conf instead:
$ vi /etc/resolv.conf
nameserver
Restart network:
$ service network restart
OR
$ /etc/init.d/network restart
Change Host name:
To change host name in Linux from command line, type:
$ vi /etc/sysconfig/network
Now, restart to make necessary changes:
$ reboot
You can then check your hostname using:
$ hostname
Local Hosts:
I ran into some problems when I didn’t update the local hosts file:

$ vi /etc/hosts

Update to reflect you hostname:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 
y.y.y.y

Create a User:
  1. Using Vsphere console for CentOS, create a user:
    1. create a user: adduser felix
    2. set password: passwd felix
  2. Next we need to give the user sudo permission:
    1. install sudo: yum install sudo
    2. edit sudoers: visudo
    3. append: felix ALL=(ALL) ALL Note: I think it might be better practice to add the user to a group e.g. wheel and give them sudo permission(?).
Installing VMware Tools:
The first steps are performed on the host, within Workstation menus:
Power on the virtual machine. After the guest operating system has started, choose VM > Install VMware Tools.
The remaining steps take place inside the virtual machine.
Mount the VMware Tools virtual CD-ROM image (if not auto mounted):
$ mkdir /media/cdrom
$ mount /dev/cdrom /media/cdrom
Extract the installer, and unmount the CD-ROM image.
$ cd /tmp
$ tar zxpf /media/cdrom/VMwareTools-5.0.0-.tar.gz
$ umount /dev/cdrom
Run the VMware Tools tar installer:
$ cd /tmp/vmware-tools-distrib
$ ./vmware-install.pl
Note 1: you might need to install perl: yum install perl
Note 2: you can uninstall using vmware-uninstall-tools.pl
You should now see confirmation of VMware tools in the summary tab in vSphere:
References:

Advertisements