faqts : Computers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

31 of 38 people (82%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

VMware HOWTO
How to install a secondary virtual machine on your dedicated server?
How to maximize your computer resource utilization?

Jul 22nd, 2008 09:39
Hossam Hossny, dman, i can do it, Parag Sharma, Sakir Ali, Kalu Ral, Abdel Wahab Salah, http://www.dedicatedservers.com.ru


----------------------------------------
This HOWTO was written by
Hossam Hossny
All Rights Reserved
http://www.trexle.com
----------------------------------------
Download the iso images of the operating system you are planning to 
install with:
wget path/to/os/iso/images/
Download apt with:
wget path/to/apt/
Install apt:
rpm -Uvh apt
Download and install kernel-sources as you will need it to compile 
vmware modules:
apt-get install .*kernel-source*
and choose the appropriate kernel sources that match your current 
running kernel version.
Download and install vncserver:
apt-get install .*vncserver*
this will download and install vncserver and all other necessary 
packages (xf86, etc..).
Run vncserver:
vncserver
you will be asked for a password to assign to vncserver, use a very 
hard to guess password!
Connect from your local machine to your dedicated server using vnc 
viewer, login using the password you have assigned to vncserver. You 
should be running xf86 now on your local machine.
Download and install VMware:
wget path/to/vmware/
tar xzvf vmware
cd where-you-extract-vmware
./vmware-install.pl
then follow the instructions.
When prompt to install networking, choose yes and use both "host only" 
and "nat" networking. Assign 192.168.0.1 to the "host only" interface 
vmnet1 and 192.168.1.1 to the "nat" interface vmnet8.
Run vmware:
vmware -G
Configure your virtual machine (hard disk space, guest os, etc..) and 
dont forget to register it (this is important to be able to access it 
remotely using vmware remote console as we will explain later).
Configure your virtual machine cdrom to be an iso image, select the 
first iso image that you downloaded of the operating system that you 
are planning to install. That would look like as if you have inserted 
the first cd in the physical cdrom.
Power on your virtual machine, it should boot normally to the 
operating 
system installer.
Continue installing your operating system, whenever you are prompted 
to 
insert the next cdrom, disconnect the virtual cdrom drive, select the 
next iso image as the virtual cdrom image, reconnect it again and 
continue with your operating system installation.
When prompted to enter the networking details, assign 192.168.1.2 to 
the nat interface (do not use dhcp).
Now you installed your operating system, reboot your virtual machine, 
power it off and kill your vncserver and uninstall it.
I recommend that you also uninstall xf86 in case that you install it 
for this document purpose only.
Install vmware in your local machine in order to be able to access 
your 
virtual machine remotely using vmware remote console. Run vmware 
remote 
console locally, connect to your server using its IP address and root 
account, and you should see a list containing your registered virtual 
machine. Power it on and when it boots login to it using its root 
username and password.
This is not necessary but highly recommended...
Download webmin to your virtual machine using:
wget path/to/webmin/
Install it:
rpm -Uvh webmin
Add a default route from your virtual machine to your dedicated server 
using:
route add default dev eth0 gw 192.168.1.1
Now logout from your virtual machine, detach and exit your remote 
console.
Within your dedicated server enable ipv4 forwarding using:
sysctl -w net.ipv4.ip_forward=1
I assume that you have requested an additional IP address to your 
virtual machine from your ISP.
Configure nat to route traffic to this IP address to your internal 
virtual machine using:
iptables -t nat -A PREROUTING -i eth0 -d *ip address* -j DNAT --to-
destination 192.168.1.2
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.2 -j SNAT --to-
source *ip address*
Note that eth0 should be able to accept traffic heading to *ip 
address* 
using any virtual interface (eth0:1, eth0:2, etc..)!
Now allow traffic to your virtual machine using:
iptables -A INPUT -i eth0 -d *ip address* -p tcp -j ACCEPT
iptables -A INPUT -i eth0 -d *ip address* -p udp -j ACCEPT
From your local machine login to your virtual machine using your web 
browser, connecting to your IP address and port 10000.
and that's all.
Cheers,
--mBf