Friday, March 13, 2009

VMWare Player Networking on Windows 7 Host

After having trouble getting any VMWare Virtual Machines to have internet access when running in VMWare player 2.51 with Windows 7 Beta as the host system I resolved the get the problem solved today. I ended up finding all of the information I needed spread around on multiple sites throughout the web. So if you are having trouble hopefully this can help.

Here are the issues I had:
  1. After installation a user account _vmware_user is shown on the Windows 7 Welcome Screen

  2. Virtual Machines can ping out to the internet without a problem, but when trying to load webpages they fail to load.

  3. After installation Windows Firewall defaults to Public Network settings.
Here is how I took care of these issues
  1. This solution was found on another blog (http://blog.stealthpuppy.com/windows/hiding-the-vmware_user-account-in-windows-7)

  2. This problem involved a little bit more digging and combing pieces found on multiple sites. It seems that some people do not have this problem but others do. If you are one of these people, and your problem is similar to the issue I described above this worked for me.


    Step 1:

    Follow the procedure below which is outlined here. We are going to setup a virtual network adapter to use Windows 7 ICS to get its internet connection. There is another procedure outlined in the comments on this page which sets up the virtual adapter to get its address from our local network, but this did not work for me and resulted again in being able to ping internet addresses, but not load them. Also I tweaked the procedure a bit to make it a bit easier.

    1. Start vmnetcfg.exe as administrator. This executable is located in \Program Files\VMware\VMware Player.

    2. Goto Host Virtual Adapters and remove all VMNet instances (VMNet1 and VMNet8 typically).

    3. Click Apply.

    4. Add and Assign it the new adapter to VMnet1.

    5. Select the Host Virtual Networking tab.

    6. Click the > next to VMnet1, choose Subnet, and change the IP addresses and Subnet mask to the ICS network (192.168.0.0 / 255.255.255.0). Click OK and then Apply

    7. Click the > next to VMnet1, choose DHCP, and make the Start IP address and End IP Address are in the correct network. Mine defaulted to 192.168.0.128 and 192.168.0.254 respectively. If you had to change them click OK and then Apply. Otherwise go to the next step.

    8. Click the > next to VMnet1, choose NAT, and change the Default Gateway Address to the ICS Network default gateway (192.168.0.1). Click OK and then Apply.

    9. You can now close the Virtual Network Editor program.

    Step 2: Now we need to enable ICS in Windows 7.

    10. Open up the Network and Sharing Center

    11. Left click on the adapter you are using to connect to the web a. If you are using a wired connection this will most likely be Local Area Connection 1 and if you are using Wireless is will be Wireless Network Connection. This will open the Network Connection Status window.

    12. Click Properties

    13. Select the Sharing tab.

    14. Check the box "Allow other network users to connect through this computers internet connection."

    15. In the Home Networking Connection Box choose "VMware Network Adapter VMnet1".

    16. Click OK.

    17. Click Close.

    Now we are almost there, but we still have one configuration problem. Windows Networking thinks that the Virtual Network Adapter is on a Public Network, which causes Windows Firewall to default to Public Network settings, which disables ICS. You have two options now. One will fix the issue till your next reboot, then other is a more permenant solution.

    Option #1: Tell Windows the Virtual Network is Private

    1. You should still be looking at the Network and Sharing Center, if not, open it.

    2. Click the Unidentified Network and change its setting to Home or Work which will make it a Private network.

    3. That's it, open up VMWare Player, Click Devices, choose Network Adapter, and Host-only. Your VM should now be able to connect to the internet.

    4. The only problem with this solution is next time you restart Windows you will need to go back into the Network and Sharing Center and reclassify the Unidentified Network as Private again. Or check out Option #2.

    Option #2: Classify Virtual Network Adapter as an Endpoint Device
    (Also the solution to Issue #3)

    1. Just follow the procedure outlined here. (http://www.nivot.org/2008/09/05/VMWareVMNETAdaptersTriggeringPublicProfileForWindowsFirewall.aspx)

    NOTE: In order to execute a PowerShell script you will need to enable PowerShell scripts. This involves a registry edit as outlined here. (http://computerperformance.co.uk/powershell/powershell_cmdlet.htm)

    2. Thats it, open up VMWare Player, Click Devices, choose Network Adapter, and Host-only. Your VM should now be able to connect to the internet.
Well that is it for now. Hopefully this helps a few of you who are still having trouble. This solution seems to be working great for me.

Welcome

After a week full of random computing related issues ranging from:
  1. Screwing up a hard drives partition table
  2. Getting Aircrack-ng to work in Ubuntu
  3. Coaxing VMWare Player to work correctly in Windows 7
And successfully conquering all of these issues. I decided it was about time for me to share my solutions with the rest of the world. As I come across, and hopefully solve, the computing problems that seem to always find me I will be posting them here for all to see. Maybe this blog can help you solve a similar issue.