VMware Horizon Community
mg381
Contributor
Contributor

Script to reinstall/update vmxnet3 driver for Win7

When I do a recompose of my Windows7 VM's they always lose network connectivity. it happens to about 60% of them, and is different and random on each. What I have figured out is that on the machines that lose the network connectivity, the Ethernet controllers not working right. When you view the Network Controller in the device manager, it is listed under the "Other Devices" section. If I right-click on the driver and choose update driver software then the driver will update and show up in the correct location in the device manager, the Ethernet Controller gets and IP, and connectivity is restored.

So what I would like to do is run a post-sync script that reinstalls or updates the network driver once the post customization process is finished. I don't even know if this will work, but would like to try it.

Does anyone else have this issue with Windows 7? and know a fix for it?

Thanks

0 Kudos
8 Replies
chaz112182
Enthusiast
Enthusiast

having the same issue .. did you find a fix ??

0 Kudos
mg381
Contributor
Contributor

No.

I've stopped trying to use Windows7 as the parent VM. View is just not ready for it. We have so many problems w/ PCOIP on Win7 too.

I called up VMware support and they confirmed this to be a problem but wouldn;t help me because Win7 in not fully supported. They say Win7 may be supported in View 4.5, but they have no release date for that and couldn't confirm Win7 full support.

So for now we are going back to XP for the parent VMs.

0 Kudos
chaz112182
Enthusiast
Enthusiast

thanks for the quick reply . thats not good. what about using win 7 stictly via rdp ??? did you try that ?

0 Kudos
mg381
Contributor
Contributor

RDP works good with Windows 7. All our test users actually preferred RDP over PCoIP for the Win7 test VMs with View.

But the problem with the network adapters still persists. It's a pain to have to go into the VMs that have a failed network adapter using the vSphere Client to updated network adapter driver. It is definitely a bug, (VMware confirmed) because it is random, it doesn't happen to all the VM's only some of them. Sometimes it happens to about 50% of the VMs after a recompose, and sometimes it happens 10%, and sometimes 90%. If it was consistent I would feel better because it would lead me to think i did something wrong on the parent VM, but it's random which tells me it is a bug.

Good luck.

0 Kudos
chaz112182
Enthusiast
Enthusiast

we actually have panologic zero clients that wont support pcoip so thats good news. panologic's connection broker actually supports windows 7 but it cant do any linked clones, patch manangement etc which is what i like about desktop virtualization . did you try the e1000 adapter ??

0 Kudos
mg381
Contributor
Contributor

Actually, i did get a powershell script to remove the network adapter and install a new one. But it didn't solve my problem. Here is the script. I think i may have updated if after my last save, but it will give you an idea of what i tried to do:

#load the vmware powershell automation commands
if (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) 
{	
	Add-PSSnapin VMware.VimAutomation.Core
}

#connect to vcenter
Write-Host "Connecting to Virtual Center Server"
Connect-VIServer vcenter

#VIServer Folder
$VMnamePattern = "Win7-*"

#remove Network adapter from all VMs matching pattern $VMnamePattern
Write-Host "Removing Network Adapters from all VMs matching pattern:" $VMnamePattern
Get-VM -Name $VMnamePattern | Get-View | %{
  $vm = $_
  $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
  $vm.Config.Hardware.Device | where { $_.GetType().BaseType.Name -contains "VirtualVmxnet" } | %{
    $dev = New-Object VMware.Vim.VirtualDeviceConfigSpec
    $dev.operation = "remove"
    $dev.device = $_
    $spec.DeviceChange += $dev
  }
  $vm.ReconfigVM($spec)
}
$enter = Read-Host "Finished Removing Network Adapters from VMs"




#get all VMs starting with $folder
$VMs = Get-VM -Name $VMnamePattern

#cycle through VMs
foreach ($vm in $VMs)
{
	Write-Host "VM Name: " $vm.Name
	New-NetworkAdapter -VM $vm.Name -NetworkName "Virtual Machine Network" -type Vmxnet3 -StartConnected
}




#get all VMs starting with $folder
$VMs = Get-VM -Name $VMnamePattern

#start all VMs
Write-Host "Start all retrieved VMs"
Start-VM $VMs


$enter = Read-Host "Done, Press 'Enter' to exit."

0 Kudos
mg381
Contributor
Contributor

I haven't tried the e1000 adapter. we were planning on spinning up a lot of VMs with View, and wanted to use the vmxnet3 adapter because it's suppose to save on host CPU usage.... i'll try the e1000 and see if it makes a different. the vmxnet3 does work very well with the XP parent VMs, but maybe something odd is going on with the Win7 VMs.

0 Kudos
myrkx
Contributor
Contributor

I have had continuous problems with the vmxnet3 nics using rdp on standalone vms. Everyday you would be unable to rdp, ping or anything else till you logged on via vSphere client, then it would work till next day. Last week, I disabled that nic and installed the e1000 nic's which seem to work so far. Microsoft told me that Windows 7 doesn't work with vmxnet3 and to stick with the e1000. FYI, my XP pro vm's with vmxnet3 work with no problem.

0 Kudos