Login
     
 
     
Articles:
List of all articles
List by categories
Search in articles
>> admin_tools
>> c
>> cli
>> database
>> debian
>> games
>> gnu
>> hardware
>> internet
>> linux
>> microsoft
>> network
>> os
>> php
>> programming
>> python
>> security
>> server
>> shell
>> text_editor
>> tools
>> web_dev
Links:
List all links
List by categories
Search in links
Online Tools:
>> gnuvd
Other Things:
Login
Admin
Pages
Blog
News
Guestbook
Contact
Sponsors:
None Yet!
Sponsor this project
That's not a published item! You are not allowed to see the content of this item!
[ Source ]

Create virtual machines with vmware-server

Created: 2007-11-28 23:19:00
Modified: 2008-11-20 01:29:00
Categories: tools server
Keywords: vmware virtualisation
Description:

vmware is a tool to create virtual computer, it let you create virtual computers ready for testing purpose. Vmware virtual computers can be use for production servers too

Introduction

vmware is a nice tool to play with virtual computers. It permit you to create virtual computer, ideal to install some operating systems on your running operating system. This allow you to experiment with "computers" without affecting you host computer. All what you may mess up in the guest computer will not affect the host.

During the install, you will be asked to enter a license key. You should need to get a license key from the website of vmware. You can easy get the license key for free. You just need to fill in your email and you get the license key directly. No need to wait to get a mail.

Note that there's currently a new version of vmware-server. Version 2. The file you may download become kinda bigger and reach now the 540 MB. The installation procedure is the same. The only different when using it is that now the console is web based. There is the traditional unencrypted http and runs default on port 8222 and the encrypted https is default on port 8333. I will update this article with more info about this new version once i get used to it as this is kinda new for me too ;-)

Installing vmware

Extract the compressed file.

tar xfv VMware-server-1.0.4-56528.tar.gz
cd vmware-server-distrib

Start the installer:

./vmware-install.pl

Follow the steps indicated on screen. You need to answer a bunch of questions. The default may be good. If you want to do it right, you should install the stuff in /usr/local.

Then you get maybe an error about the gcc version if you are running Debian testing:

Trying to find a suitable vmmon module for your running kernel.

None of the pre-built vmmon modules for VMware Server is suitable for your 
running kernel.  Do you want this program to try to build the vmmon module for 
your system (you need to have a C compiler installed on your system)? [yes] 

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

Your kernel was built with "gcc" version "4.1.3", while you are trying to use 
"/usr/bin/gcc" version "4.2.3". This configuration is not recommended and 
VMware Server may crash if you'll continue. Please try to use exactly same 
compiler as one used for building your kernel. Do you want to go with compiler 
"/usr/bin/gcc" version "4.2.3" anyway? [no]

If you get this error you should need to install gcc-4.1:

aptitude install gcc-4.1

And set the environment variable and start the install again:

CC=gcc-4.1 ./vmware-install.pl

You should not get any error now.

Tracking the vmware install with paco

paco -lp vmware-server-1.0.3 "./vmware-install.pl"

Or for the any-any patch:

paco -lp vmware-server-1.0.3 "./runme.pl

Installing vmware tools on a guest

The vmware tools needs to be installed on the guest system (on the virtual machine). This will give you the copy and paste between host and guest, mouse grab features and other features. The only disadvantage to install the vmware tools is that you always need to startup a program that you may not close. If you close it, the vmware tools don't work. You can only minimize that window, but there seems to be no way to hidden it.

Before installing the vmware-tools you need to have the kernel headers of your current running kernel installed.

aptitude install linux-headers-`uname -r`

mount /cdrom
cd /tmp

tar zxf /cdrom/VMwareTools-1.0.4-56528.tar.gz
cd vmware-tools-distrib
./vmware-install.pl

Answer the different questions that are asked. The default should be right. Once installed restart X if you where in x.

To be able to make use of all the features of the vmware tools. We may start the vmware-toolbox from a console. Make in sort that this is executed at startup in your graphical environment :

vmware-toolbox --iconify &

For Gnome:

Desktop > Preferences > Sessions > Startup Programs

Click there on the add button and fill in /usr/bin/vmware-toolbox --iconify. Restart the session to test if all is ok.

In the cli console

Starting a virtual machine

vmware-cmd /mnt/data/vmware/gentoo2007/gentoo2007.vmx start

Errors

errors lost some interrupts at xHz

If you get some error with dmesg like this:

rtc: lost some interrupts at 512Hz.

You may need to do tweak the config file /etc/vmware/config and add the following:

tools.timeSync = true
host.useFastClock = FALSE
monitor_control.virtual_rdtsc = FALSE

Switching of vt with vmware in GNU/Linux

If you press ctrl+alt+shift{1..2} you change your current vt, these of the host and not that of the vmware one. There are different ways to switch to another vt.

  • press ctrl+win to switch the vt of the virtual machine.
  • ctrl-alt-space release-space fn
  • alt+left arrow (or right arrow) - This works when we are in the debian installer.
  • alt fn

dummy interfaces

This is some experimental notes as well as tests.

The issue is that i have a box that is connected directly to the internet, this box receive an IP from the ISP. On this same box, vmware-server is installed. The goal is to use one PC that has a direct internet connection, where only one network card is available and to use this box a vmware-server. So that i can test network related stuff, such as a bind, dhcp server on virtual machines. This approach tries to have a little as possible of consequences if the test server get compromised because of an insecure setup.

As i can get up to 4 different IP's. Some are used for test purpose. On the vmware server box, i create a dummy interface, gave him as IP 192.168.0.1.

Here's some basic drawing of the network:

 ------------
[ ISP Router ]
 ------------
   |    -------------
   `-- [ Switch (5p) ]
        -------------
         | | |   ----------------------
         | | `- [ Digibox (TV)         ]
         | |     ----------------------
         | |     ----------------------
         |  `-- [ Wifi router (4p)     ]
         |       ----------------------
        -------------
       [ Switch (8p) ]
        -------------
         | |     ----------------------
         |  `-- [ TEST SERVER + Vmware ]
         |       ----------------------
         |       ----------------------
         `----- [ GATEWAY SERVER       ]
                 ----------------------
                     |
                 -------------
                [ Switch (8p) ]
                 -------------
                | | | | | | | |   ----------------------
                | | | | | | | `- [ File/auth server     ]
                | | | | | | |     ---------------------- 
                | | | | | | `--- [ Web server           ]
                | | | | | |       ----------------------
                | | | | | `----- [ Main PC              ]
                | | | | |         ----------------------
                . . . . .
  • Wifi router - Mostly only use for laptops. If local LAN access is required, the only way: use VPN.
  • GATEWAY SERVER - Has two nic's. Is a simple old box that share the internet for some other clients. This is a firewalled box and is connected to a trusted network.
  • TEST SERVER - Has one nic.

On client side, we can setup different network setup's. With this, i mean in the vmware's network options of the virtual machine:

  • Select Bridget: Connected directly to the physical network. I don't know why, but if i select this, i get as error The network bridge on device /dev/vmnet0 is temporarily down because the bridget Ethernet interface is down. The virtual machine may not be able to communicate with the host or with other machines on your network.. Usually i select this Bridget connections, as this seems the most native way to simulate that this is virtual computer is directly connected to the network.
  • Select NAT: Used to share the hosts's IP address. With this, the virtual machine get his IP from the build in DHCP server from vmware. I get as IP 192.168.182.254.
  • Select Host-Only: A private network shared with the host. I then get an IP of the vmware's build in DHCP server. IP i get is 172.16.7.254.
  • Select Custom: Specific virtual network /dev/vmnet2 I then get an ip of my ISP.

On server side:

modprobe dummy

echo 192.168.0.1 $HOSTNAME >> /etc/hosts

In /etc/network/interface:

auto dummy0
allow-hotplug dummy0
iface dummy0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
        # dns-* options are implemented by the resolvconf package, if installed
#        dns-nameservers 192.168.0.20
#        dns-search pinguin

To load the dummy module at boot time:

echo dummy >> /etc/modules

Extra tools

vmware-mui

Vmware provide also a nice web interface to manage virtual machines.

Installing is peace of cake. Extract the VMware-mui-1.0.4-56528.tar.gz and then start up the installer:

./vmware-install.pl

Once instaled, you may point your browser to https://localhost:8333/. Log in with a regular user of the system or as root user if you plan to manage some more things.

Resources

Comments leaved by users (total: 0)

No comments yet!

Add a comment

obfuscated letters
 
  • Do you know that you may use some special markup syntax to create header, italic, bold, styling and links and much more. See the sandbox for the markup language.
  • Do you need some other help?

[ Toggle on/off history ]

Item History:

127 | 2008-11-20 01:33:48 | view diff
Added some notes in the introduction about the new vmware-server 2 version.

Login:
User Name
Password

Last Articles
python stuff concerning python
2009-07-22 12:00:00
vim
2009-06-06 23:53:00
fluxbox
2009-05-23 12:42:00
setting up a toshiba satellite a110-178
2009-05-21 15:35:00
create a secure virtual private network with openvpn
2009-04-25 13:34:00
>>> Read more...

Last News
Released pyguicms 1.0.0-beta1
2008-06-02 21:20:00
guicms replaced by pyguicms
2008-04-27 17:39:00
pyguicms up and running and online
2007-11-29 22:31:00
>>> Read more...

Last Links
mxtoolbox
2009-09-25 17:54:00
minibikeshop
2009-09-05 12:43:00
magicbike
2009-09-05 12:40:00
systranet
2009-07-22 11:42:00
transfer big files
2009-07-22 11:42:00
>>> Read more...

Last Pages
sandbox
2008-09-07 22:30:00
about
2008-09-07 22:29:00
help
2008-09-07 22:25:00
welcome page
2008-09-07 18:27:00
python stuff to check
2007-12-03 00:16:00
>>> Read more...