My VMware Info Page.

Summary: This document may be particularly useful when you have a DSL modem and a small home network using microsoft internet connection sharing (ICS). Vmware seems to have a lot of trouble picking the correct ethernet card.  One solution is documented here.

I wanted to learn about linux, but I was not quite confident enought to start messing with my hard drive partitions and wreaking possible havoc with my windows 2000 system. I chose to play with VMware (www.vmware.com) first, which allows you to run many virtual linux systems as a gues OS under windows 2000.  This way you can play with various installations, workstation, server, you name it.  You can try the software out for one month at no cost, and during that time you can see if Linux is something you want to get more serious about. I will probably just buy VMware at the end of my trial, or my simply set my computer up for double booting and keep my $300.

There were various headaches I encountered, but found most answers in the newsgroups.  Easiest way to get the info is by going to groups.google.com and searching for vmware.

Installing vmware and linux:

First thing to do is to get the software from vmware.com and also get two useful documents. The first is their 'getting started guide' which you can get under support -> workstation for windows 2000. This tells you how to install vmware onto your win2000 machine.

Then I chose to install Redhad linux 7.1. Again, vmware has support documents on various guest operating systems.  Choose the appropriate one and follow the directions. The main thing they tell you is not to worry about all the video settings. Just skip all that and then follow vmware's cues about installing vmtools. This all worked very nicely.

Getting networking to work (surfing the net with DSL and an ICS home network):

Once you have linux running under vmware, you will at least want it to have network access, so you can browse the internet.  All of the suggestions at the vmware website are fine if you are at a company with ethernet right to your desk.  The main idea is that you 'bridge' the virtual machine to your hardware ethernet card, and then the virtual machine registers itself on the network etc.

I am at home and have a DSL modem, which is hooked up to an ethernet card in my PC.  Then  I have a second ethernet card which is connected to a hub and some other computers and printers.  Using ICS, internet connection sharing, these computers can access the internet.  I wanted my virtual machine to join my little home network. This took SEVERAL DAYS to figure out, since there are apparently some bugs (from what I could read out of newsgroups) in vmware which confuses it as to which ethernet card you want to bridge to. It does not say this anywhere at vmware (as far as I could figure out) but you have to bridge to the ethernet card which is hooked up to your home network, NOT the card which goes to the DSL modem. If you do the latter, the guest linux OS will try to request an IP address from the DSL modem side, but with most basic DSL services, you are only allowed one IP address.

After much newsgroup reading I found two ways which are supposed to solve the problem. Only the latter worked for me, and it involved messing with the windows registry.  The problem was that vmware had set it's sights onto the wrong ethernet card, and in the end, no matter what I tried, I had to manually change registry entries to fix the problem. In any case, here are some notes I kept on my progress:


A first step was to get some sort of networking to work at all, this is useful if you don't have a home network, and just one computer and either a DSLor regular modem connection.

Getting linux networking to work.

One way to get the following setup to work:

PC running windows 2000 workstation (sp1)

One NIC

Cable modem or DSL

In short, you want to create a virtual NIC as described below, and then use internet connection sharing (ICS) to link your real NIC (which is hooked up to your cable modem or DSL modem or a non dialup like a cable modem).

How to do it:

Set up a virtual host adapter as described at vmware website.

http://www.vmware.com/support/ws2/doc/hostonly_w2k_ws_win.html

As a check, right click on 'my network neighborhood' -> properties

You should see a new connection. Right click on it -> properties and it should identify itself as a VMware virtual network adapter.

If you are using a cable modem or some other form of non dialup networking, (For dialup see below)

Right click -> properties on the ethernet card through which you are currently conneced to the net. Then go to the sharing tab, and click the 'enable internet connection sharing' box.

That should do it.

If you are using a dialup modem, or even DSL with PPPoe (like me) then right click on the dialup connection etc. and do the same there.

If you have multiple NICs in your computer, you may also have to select the NIC you want to do the sharing through. (see the next section for this)

Now, turn on your vmware application, and got to settings. Choose ethernet adapters and then set ethernet1 to 'host only'


Now, if you have two ethernet cards in your computer, have a home network using ICS and want to have the virtual machine join your home network, then you want to bridge your vmware virtual ethernet adapter to the ethernet card which is hooked up to your home network. If you are lucky, vmware chose the right card to bridge to when you installed vmware.  Not so in my case, I had to change thins in the registry to make this happen. Here are two suggestions I found in the newsgroups. Only the second worked for me (again my notes):

You want to bridge your network to the ethernet card which is connected to the other computers in the house. The vmware installation generally does not ask you for which card, so you have to do it yourself:

There are two suggestions. If you are bold, read the whole message, and try only the the second method, in which you make some changes in the registry. If you don't want to mess with the registry unless absolutely necessary, then try the next first:

Chuck gladu suggests:

-Make sure both Nic's are up and working and connected to their networks.

-Power off all VM's

-Exit out of Vmware.

-Stop the Vmnet Bridge Service

This is done by going to the control panel -> administrative tools -> services. Right click on the vmnet0 service and stop it.

-Go to a command prompt and go to the vmware\ programs directory (under wherever you installed Vmware). Do this by Start -> run and type in cmd. This gives you a dos like window. Now go to the mentioned directory.

-Run 'vnetconfig -s -ib vmnet0' (this is a little undocumented program that comes with vmware, search for it using your widows find command, then open up a command line window (start -> run, then type cmd, and use dos commands to get to the appropriate directory)

-You should be given a choice of your two NIC's here. Pick one of them (It doesn't matter which one... I'll explain below)

-Start the Vmnet bridge service (or reboot the host) i.e. right click on the service and start it.

-Test and see if you are bridged to the correct network. I did this by booting up my virual machine and seeing if I got the OK on eth0 (I did not)

-If not, then redo the steps above but choose the other NIC.

I redid it several times, without luck.

NOTE:

The reason that it doesn't matter which NIC you choose is that vnetconfig has a bug that causes the displayed NIC names to not always match up to the internal NIC id's. So if you have multiple NIC's you sometimes need to follow this trial and error process until you hit the correct NIC.

Before you ask, the reason that vnetconfig's bug has not been fixed yet (and probably won't be) is that vnetconfig is an undocumented tool that was never really meant for end users. And if the new networking code in GSX Server for NT/ 2000 gets backported to the Workstation product (which I suspect it will be) then vnetconfig will become obsolete. So it probably isn't worth much of someone's time to fix it right now


This should have worked, but did not:.  The following did work:

From: Thomas Bing (thomas@i-nettmedia.no) Subject: Re: Network Bridge

Newsgroups: vmware.for-windowsnt.configuration Date: 2001-06-11 02:26:45 PST

Hi, I've posted this on a couple more articles, they seem to be into the same deep waters:

1. It seems that I can never get the networking to work when I'm actually not connected physically to a network, even if I use host-only networking and have the VMWare virtual NIC up and running.

I've sort of brough on my own troubles, I know, since I run all of this on a laptop that I use either a PC Card NIC with, or the integrated NIC that's in the docking station. That means the vmnet bridge service binds to the NIC that's in use at the time of installation. Furthermore, I have enabled and disabled the various NICs numerous times, in order to reduce network timeouts in different working scenarios. (By the way; I've also tried installing VMWare while I have only the MS Loopback adapter enabled, to try to make the vmnet bridge serice hook into the MS "NIC", but it's a no go.)

First, as described above, stop the vmnet0 service.

2. In order to make the vmnet bridge service bind the exact NIC I want it to, I had to do some Registry work. TO do this for yourself, go to Start -> run -> cmd then type regedt32 (or do this directly from the run line.) I found that under HKey_Local_Machine\SYSTEM\CurrentControlSet\Control\Network\{GUID}\ are listed all the NICs by their GUID (ugly hex-string).

In other words, find the ..\network\ folder mentioned above, and just double click everything you can, opening things up to the lowest level. At some point, you will find keys like which may look something like {66525611-5824-44A8-9E4F-C4955B8D9C68}. Double click on this, and there will be one last folder called 'connection'. single click on this and the right half of the window will display which actual ethernet card is connected to this key. Mine would say something like:

Name: REG_SZ: 3com 4 where 3com 4 is one of the names I see when I righclick properties on my network places icon on the desktop. I had to open first the top-level GUID ("Network Adapters") and then open each NIC (sub-GUID) and look under \{GUID}\Connection and read the Name value (if you're unsure which is which, just rename the different adapters under Start\Settings\Network and Dial-up Connections, and then the name you give it is reflected in the Name value in the Registry.)

Once you've found the correct NIC, you now know it's GUID (tip: right-click the Registry key and 'Copy Key Name' [this did not work for me, I had to use the 'save key' option under the file menu, open the saved file in a text editor, and look for the key information within a bunch of other hexadecimal junk]). Next you need to find the settings for the vmnet bridging service, under HKLM\SYSTEM\CurrentControlSet\Services\vmnetbr0. If you look under \vmnetbr0\Parameters\ you find the value NetworkDevice, which reads "\Device\{GUID}". This is the GUID you need to replace with the GUID of the NIC you want the service to bind to (i.e. the stuff you just copied), and then just restart the vmnetbr0 service.

Now restart the vmnet0 service, restart vmware, boot your linux guest OS, and if you are lucky (it worked for me) the booting process should give the OK to eth0.

Now I am still not entirely happy, since these windows ICS type networks don't necessarily let you do things like have other computers open up xwindows on your machine, or start ftp sessions, but at least I have made some progress. I am working on the latter matters. (windows allows you to pass certain processes on to certain computers on your network. You can, for instance, tell windows to send incoming ftp requests to ONE computer on your ICS home network. It's not ideal, but it makes a few things possible.  While you are learning about linux, it is not a bad thing to be a little shielded from the outside world.

Good luck, hope this works for you.


Next I want to start using linux to learn about PERL and various other things.  I could simply start messing around and save my files on the virtual linux drive that vmware creates for you.  Whatever files you make would then be invisible to your windows machine. I would much rather just have linux read and write to my windows files and folders, so I still have all my stuff after in case I decide to abandon vmware, or in case something goes wrong with vmware. (WARNING: I am not certain about this, but your hard drive may need to be formatted FAT32 (versus NTFS) for this to all work smoothly.  At least give it a try).

Typically one uses the mount command to mount volumes as directories in the unix file system. If you have a double boot system, this is a perfectly good way to do things. If you are running vmware, and two operating systems are potenentially meddling with the same files, you are asking for trouble.  The solution is Samba (SMB).  Here's what I did to get it to work on my machine:

setting up file sharing between windows and vmware running linux.

WARNING: it is not a good idea to use a direct mount command (did not figure out how to work it anyway) since this means that both linux and windows can access files at the same time, causing problems.

Use SMB (Short message block) protocol commands. This means that you first have to be sure that your windows machine is set up for file sharing.

This may have to be done under administrator. Since I usually only log in as administrator, I chose to create a new regular user first.


CREATE A REGULAR USER:

go the the users and passwords control panel, and add a user.


CREATE A SHARED DISK:

Open My computer, and right click properties on the disk you want to share.

Click the sharing tab.

Now you have to give the drive a 'share name', i.e. how the rest of the world will talk to this thing.

Click the NEW SHARE button

Give it a name (like windrive)

click the permissions button

I usually remove the 'everyone entry' and then click the add button.

Add whichever users you want, and give them the appropriate permissions.

That basically does it. You can also share individual folders and files in the same way.


MOUNTING THE SHARED VOLUME UNDER LINUX.

You can first test it out by using smbclient (an ftp like thing which lets you transfer files) to see if you can connect to the disk.

The following command is for connecting to a drive on the computer 'mycomputer' on the HOME workgroup, connecting to a shared drive called 'd', logging on as user jane.

smbclient //mycomputer/d -W home -U jane

Then you will have to type the password and you are in. (type things like ls and such to move around on your windows drive) Type exit to leave.

(Usually this works without the -W home command.)

Now, to mount a whole drive so you can see it transparently in unix. Log in a root:

smbmount //mycomputer/d /mnt -o username=jane

This works,but does not give proper access to non root users. To give proper access for other users to both files and directories, do

smbmount //mycomputer/d /mnt -o username=jane,gid=users,fmask=0775,dmask=0775,rw

The gid=users is for the case where the root has made various people part of the group users

The latter is done by going into the file /etc/groups and putting a list of

people after the users entry, like so:

users:x:100:jane,john

the x stands for the password, the 100 stands for the gid or groupid.

Hopefully this will work.

To unmount, in this case, type

umount /mnt/ublimaarten/d