Remember to upgrade Virtualbox Guest Additions when you upgrade Virtualbox!

If you’re wondering why you might not be getting access to your shared folders in your guest OS after upgrading Virtualbox, this could be the reason. Virtualbox Guest Additionals (like VMware tools for Virtualbox) might need to be upgraded as well.

You can expect a system error 53, network path not found if the Guest Additions is not installed. When in the UI, it will say something like this: “Windows cannot access \\vboxsvr error code: 0x80070035 The network path was not found.”

Hope this help!

Using vim-cmd to remedy a bsod

Here’s a great tutorial for vim-cmd if you haven’t had experience with it before by my friend, Steve

This is a real-world situation I got myself into when I tried connecting to my client VM and found a BSOD that looked like this:

It’s pretty obvious that the reason for the crash is the USB stick that’s plugged in from the usbuhci.sys line in the blue screen. Since I tunnel into my client VM via SSH and VNC, the easiest way for me to shutdown my VM and remedy this issue is through vim-cmd. This only works if you have SSH allowed onto your ESXi host or if you are connecting to the host with the VMware CLI or vMA or whatever they’re calling it these days. I have the former.

The first thing I do after logging into the ESXi host as root is run:

vim-cmd vmsvc/getallvms

I need to know which one of my VMs is the one to manage. I get this:

Vmid Name File Guest OS Version Annotation
1 windows7 [BIG_DISK] windows7/windows7.vmx windows7_64Guest vmx-07
3 thimble [BIG_DISK] thimble/thimble.vmx ubuntu64Guest vmx-08
4 chunli [Datastore 2] chunli2/chunli2.vmx ubuntu64Guest vmx-08
5 zangief [Datastore 2] zangief2/zangief2.vmx ubuntu64Guest vmx-11

With this information, I know that it’s VM 1, so I power it off by running:

vim-cmd vmsvc/ 1

Thinking the USB issue might be a fluke, I try to power the VM back on to see if it will boot.

vim-cmd vmsvc/power.on 1

I see that it starts booting, but as the resolution changes on the VM, my VNC viewer freezes. Since I normally don’t know exactly when it freezes, I didn’t know when I got the BSOD again.

Until I decided to at look at the vmware.log file. This is what I saw there:

2017-10-18T22:27:05.519Z| svga| I125: SVGA disabling SVGA
2017-10-18T22:27:05.545Z| svga| W115: WinBSOD: (20) 'Technical information: '
2017-10-18T22:27:05.545Z| svga| W115:
2017-10-18T22:27:05.546Z| svga| W115: WinBSOD: (22) '*** STOP: 0x000000D1 (0xFFFFF88000BF2000,0x0000000000000002,0x0000000000000001,0'
2017-10-18T22:27:05.546Z| svga| W115:
2017-10-18T22:27:05.546Z| svga| W115: WinBSOD: (23) 'xFFFFF88004206E49) '
2017-10-18T22:27:05.546Z| svga| W115:
2017-10-18T22:27:05.557Z| svga| W115: WinBSOD: (26) '*** usbuhci.sys - Address FFFFF88004206E49 base at FFFFF88004200000, DateStamp'
2017-10-18T22:27:05.557Z| svga| W115:
2017-10-18T22:27:05.557Z| svga| W115: WinBSOD: (27) ' 57b37a29 '
2017-10-18T22:27:05.557Z| svga| W115:
2017-10-18T22:27:05.557Z| svga| W115: WinBSOD: (30) 'Collecting data for crash dump ... '
2017-10-18T22:27:05.557Z| svga| W115:
2017-10-18T22:27:05.573Z| svga| W115: WinBSOD: (31) 'Initializing disk for crash dump ... '
2017-10-18T22:27:05.573Z| svga| W115:
2017-10-18T22:27:07.547Z| mks| W115: Guest operating system crash detected.

Okay, so I see that my hunch is correct. I guess it’s time I remove the USB device from the VM. So I power off the VM again and open up the vmx file and just start removing all instances of USB.

These are the lines I removed. Don’t worry about breaking anything. The hypervisor will put them back if you need them later. Back up your vmx file before doing it though just in case.

usb.pciSlotNumber = "34"
usb.present = "TRUE"
usb:1.speed = "2"
usb:1.present = "TRUE"
usb:1.deviceType = "hub"
usb:1.port = "1"
usb:1.parent = "-1"
usb.autoConnect.device0 = "path:1/1 autoclean:1"
usb:0.present = "TRUE"
usb:0.deviceType = "mouse"
usb:0.port = "0"
usb:0.parent = "-1"

After you’ve saved your changes, you’ll need to reload the changes so that ESXi will reread the .vmx file to remove the USB device. You can do this by running this command:

vim-cmd vmsvc/reload 1

Now you’re ready to power on the VM.

vim-cmd vmsvc/power.on 1

The VM powers up and I’m back in business. I just had to figure out the USB issue later. Turned out that I just needed to reconnect the device and reformat it. I haven’t seen the issue come up again.


esxtop shows a bunch of stuff … what’s up with this!?

It’s been a while since I’ve had to run esxtop, but when I did recently, I got a bunch of stuff on my screen like this:

o termcap entry for a `xterm-256color’ terminal”(PDH-CSV 4.0) (UTC)(0)”,”\\\Memory\Memory Overcommit (1 Minute Avg)”,”\\\Memory\Memory Overcommit (5 Minute Avg)”,”\\\Memory\Memory Overcommit (15 Minute Avg)”,”\\\Physical Cpu Load\Cpu Load (1 Minute Avg)”,”\\\Physical Cpu Load\Cpu Load (5 Minute Avg)”,”\\\Physical Cpu Load\Cpu Load (15 Minute Avg)”,”\\\Physical Cpu(0)\% Processor Time”,”\\\Physical Cpu(1)\% Processor Time”,”\\\Physical Cpu(2)\% Processor Time”,”\\\Physical Cpu(3)\% Processor Time”,”\\\Physical Cpu(_Total)\% Processor Time”,”\\\Physical Cpu(0)\% Util Time”,”\\\Physical Cpu(1)\% Util Time”,”\\\Physical Cpu(2)\% Util Time”,”\\\Physical Cpu(3)\% Util Time”,”\\\Physical Cpu(_Total)\% Util Time”,”\\\Physical Cpu(0)\% Core Util Time”,”\\\Physical Cpu(1)\% Core Util Time”,”\\\Physical Cpu(2)\% Core Util Time”,”\\\Physical Cpu(3)\% Core Util Time”,”\\\Physical Cpu(_Total)\% Core Util Time”,”\\\Memory\Machine MBytes”,”\\\Memory\Kernel MBytes”,”\\\Memory\NonKernel MBytes”,”\\\Memory\Free MBytes”,”\\\Memory\Kernel Managed MBytes”,”\\\Memory\Kernel MinFree MBytes”,”\\\Memory\Kernel Reserved MBytes”,”\\\Memory\Kernel Unreserved MBytes”,”\\\Memory\Kernel State”,”\\\Memory\PShare Shared MBytes”,”\\\Memory\PShare Common MBytes”,”\\\Memory\PShare Savings MBytes”,”\\\Memory\Swap Used MBytes”,”\\\Memory\Swap Target MBytes”,”\\\Memory\Swap MBytes Read/sec”,”\\\Memory\Swap MBytes Write/sec”,”\\\Memory\Total Compressed MBytes”,”\\\Memory\Total Saved By Compression MBytes”,”\\\Memory\Memctl Current MBytes”,”\\\Memory\Memctl Target MBytes”,”\\\Memory\Memctl Max MBytes”,”\\\Power\Power Usage Now Watts”,”\\\Power\Power Usage Cap Watts”,”\\\Power(0)\P-State MHZ”,”\\\Power(1)\P-State MHZ”,”\\\Power(2)\P-State MHZ”,”\\\Power(3)\P-State MHZ”,”\\\Power(4)\P-State MHZ”,”\\\Power(5)\P-State MHZ”,”\\\Power(6)\P-State MHZ”,”\\\Power(7)\P-State MHZ”,”\\\Power(8)\P-State MHZ”,”\\\Power(9)\P-State MHZ”,”\\\Power(10)\P-State MHZ”,”\\\Power(11)\P-State MHZ”,”\\\Power(12)\P-State MHZ”,”\\\Power(13)\P-State MHZ”,”\\\VSAN\Enabled?”,”\\\Group Cpu(1:idle)\Members”,”\\\Group Cpu(1:idle)\% Used”,”\\\Group Cpu(1:idle)\% Run”,”\\\Group Cpu(1:idle)\% System”,”\\\Group Cpu(1:idle)\% Wait”,”\\\Group Cpu(1:idle)\% Ready”,”\\\Group Cpu(1:idle)\% Idle”,”\\\Group Cpu(1:idle)\% Overlap”,”\\\Group Cpu(1:idle)\% CoStop”,”\\\Group Cpu(1:idle)\% Max Limited”,”\\\Group Cpu(1:idle)\% Swap Wait”,”\\\Vcpu(1:idle:32769:idle1)\% Used”,”\\\Vcpu(1:idle:32769:idle1)\% Run”,”\\\Vcpu(1:idle:32769:idle1)\% System”,”\\\Vcpu(1:idle:32769:idle1)\% Wait”,”\\\Vcpu(1:idle:32769:idle1)\% VmWait”,”\\\Vcpu(1:idle:32769:idle1)\% Ready”,”\\\Vcpu(1:idle:32769:idle1)\% Idle”,”\\\Vcpu(1:idle:32769:idle1)\% Overlap”,”\\\Vcpu(1:idle:32769:idle1)\% CoStop”,”\\\Vcpu(1:idle:32769:idle1)\% Max Limited”,”\\\Vcpu(1:idle:32769:idle1)\% Swap Wait”,”\\\Vcpu(1:idle:32770:idle2)\% Used”,”\\\Vcpu(1:idle:32770:idle2)\% Run”,”\\\Vcpu(1:idle:32770:idle2)\% System”,”\\\Vcpu(1:idle:32770:idle2)\% Wait”,”\\\Vcpu(1:idle:32770:idle2)\% VmWait”,”\\\Vcpu(1:idle:32770:idle2)\% Ready”,”\\\Vcpu(1:idle:32770:idle2)\% Idle”,”\\\Vcpu(1:idle:32770:idle2)\% Overlap”,”\\\Vcpu(1:idle:32770:idle2)\% CoStop”,”\\\Vcpu(1:idle:32770:idle2)\% Max Limited”,”\\\Vcpu(1:idle:32770:idle2)\% Swap Wait”,”\\\Vcpu(1:idle:32771:idle3)\% Used”,”\\\Vcpu(1:idle:32771:idle3)\% Run”,”\\\Vcpu(1:idle:32771:idle3)\% System”,”\\\Vcpu(1:idle:32771:idle3)\% Wait”,”\\\Vcpu(1:idle:32771:idle3)\% VmWait”,”\\\Vcpu(1:idle:32771:idle3)\% Ready”,”\\\Vcpu(1:idle:32771:idle3)\% Idle”,”\\\Vcpu(1:idle:32771:idle3)\% Overlap”,”\\\Vcpu(1:idle:32771:idle3)\% CoStop”,”\\\Vcpu(1:idle:32771:idle3)\% Max Limited”,”\\\Vcpu(1:idle:32771:idle3)\% Swap Wait”,”\\\Vcpu(1:idle:32778:idle0)\% Used”,”\\\Vcpu(1:idle:32778:idle0)\% Run”,”\\\Vcpu(1:idle:32778:idle0)\% System”,”\\\Vcpu(1:idle:32778:idle0)\% Wait”,”\\\Vcpu(1:idle:32778:idle0)\% VmWait”,”\\\Vcpu(1:idle:32778:idle0)\% Ready”,”\\\Vcpu(1:idle:32778:idle0)\% Idle”,”\\\Vcpu(1:idle:32778:idle0)\% Overlap”,”\\\Vcpu(1:idle:32778:idle0)\% CoStop”,”\\\Vcpu(1:idle:32778:idle0)\% Max Limited”,”\\\Vcpu(1:idle:32778:idle0)\% Swap Wait”,”\\\Group Cpu(2:system)\Members”,”\\\Group Cpu(2:system)\% Used”,”\\\Group Cpu(2:system)\% Run”,”\\\Group Cpu(2:system)\% System”,”\\\Group Cpu(2:system)\% Wait”,”\\\Group Cpu(2:system)\% Ready”,”\\\Group Cpu(2:system)\% Idle”,”\\\Group Cpu(2:system)\% Overlap”,”\\\Group Cpu(2:system)\% CoStop”,”\\\Group Cpu(2:system)\% Max Limited”,”\\\Group Cpu(2:system)\% Swap Wait”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Used”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Run”,”\\\Vcpu(2:system:32772:SVGAConsole)\% System”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Wait”,”\\\Vcpu(2:system:32772:SVGAConsole)\% VmWait”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Ready”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Idle”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Overlap”,”\\\Vcpu(2:system:32772:SVGAConsole)\% CoStop”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Max Limited”,”\\\Vcpu(2:system:32772:SVGAConsole)\% Swap Wait”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Used”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Run”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% System”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Wait”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% VmWait”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Ready”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Idle”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Overlap”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% CoStop”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Max Limited”,”\\\Vcpu(2:system:32773:debugtermlivedump)\% Swap Wait”,”\\\Vcpu(2:system:32774:logSysAlert)\% Used”,”\\\Vcpu(2:system:32774:logSysAlert)\% Run”,”\\\Vcpu(2:system:32774:logSysAlert)\% System”,”\\\Vcpu(2:system:32774:logSysAlert)\% Wait”,”\\\Vcpu(2:system:32774:logSysAlert)\% VmWait”,”\\\Vcpu(2:system:32774:logSysAlert)\% Ready”,”\\\Vcpu(2:system:32774:logSysAlert)\% Idle”,”\\\Vcpu(2:system:32774:logSysAlert)\% Overlap”,”\\\Vcpu(2:system:32774:logSysAlert)\% CoStop”,”\\\Vcpu(2:system:32774:logSysAlert)\% Max Limited”,”\\\Vcpu(2:system:32774:logSysAlert)\% Swap Wait”,”\\\Vcpu(2:system:32775:serialLogger)\% Used”,”\\\Vcpu(2:system:32775:serialLogger)\% Run”,”\\\Vcpu(2:system:32775:serialLogger)\% System”,”\\\Vcpu(2:system:32775:serialLogger)\% Wait”,”\\\Vcpu(2:system:32775:serialLogger)\% VmWait”,”\\\Vcpu(2:system:32775:serialLogger)\% Ready”,”\\\Vcpu(2:system:32775:serialLogger)\% Idle”,”\\\Vcpu(2:system:32775:serialLogger)\% Overlap”,”\\\Vcpu(2:system:32775:serialLogger)\% CoStop”,”\\\Vcpu(2:system:32775:serialLogger)\% Max Limited”,”\\\Vcpu(2:system:32775:serialLogger)\% Swap Wait”,”\\\Vcpu(2:system:32776:tlbflushcount)\% Used”,”\\\Vcpu(2:system:32776:tlbflushcount)\% Run”,”\\\Vcpu(2:system:32776:tlbflushcount)\% System”,”\\\Vcpu(2:system:32776:tlbflushcount)\% Wait”,”\\\Vcpu(2:system:32776:tlbflushcount)\% VmWait”,”\\\Vcpu(2:system:32776:tlbflushcount)\% Ready

Continue reading

How to set the NTP server on all ESX hosts in vCenter at the same time with PowerCLI

I was frustrated with a number of my lab hosts have the wrong times/timezones. Rather than going to each ESXi host to update the time servers, I ran a simple script to do it with PowerCLI.

As before running any script, you must authenticate with the vCenter or the host by running

Connect-VIServer <hostname>

Then, we’ll cycle through each of the ESXi hosts and add an ntp server. Obviously, use the time server you want i.e. or 🙂

Get-VMHost | Add-VMHostNtpServer -ntpserver ""

With that set, you can then move on to punching the hole through the firewall to request the time from the servers.

get-vmhost | Get-VMHostFirewallException | where {$_.Name -eq "NTP client"} | Set-VMHostFirewallException -Enabled:$true

#Start NTP client service and set to automatic
get-vmhost | Get-VmHostService | Where-Object {$_.key -eq "ntpd"} | Start-VMHostService
get-vmhost | Get-VmHostService | Where-Object {$_.key -eq "ntpd"} | Set-VMHostService -policy "automatic"

How to use PowerCLI to register or unregister a bunch of templates at a time …

I recently resignatured a datastore that housed all of my templates and ran into an issue with a bunch of datastores that wouldn’t unmount and a slew orphaned templates. To get rid of them, I had to unregister them all and then register them, but had a ton, so I didn’t want to do them one at a time.

Unregistering the VM templates is easy. Just select them all, right click and click “remove from inventory”. The registering part is harder – need to browse the datastore and then right click and add to inventory and give it a name. So, I did it with PowerCLI.

The first thing we want to do is get a list of all of the vmtx files in the datastore that the templates reside in. I do it like this:

$vmtxs = gci vmstore:\$((Get-Datacenter -name "DCpod"))\templates -Recurse -Include *.vmtx | select -exp datastorefullpath

You can list it and you should see something like this:

PowerCLI C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> $vmtxs
[templates] Win8.1_Template/Win8.1_Template.vmtx
[templates] Windows 10 template/Windows 10 template.vmtx
[templates] Win2K8R2_Template_1/Win2K8R2_Template.vmtx
[templates] Ubuntu_Server_Template/Ubuntu_Server_Template.vmtx
[templates] Win2K12R2_Template/Win2K12R2_Template.vmtx
[templates] webservertemplate2/webservertemplate2.vmtx

With the list of files, you can loop through and register them all on a particular host like this:

PowerCLI C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> foreach($vmtx in $vmtxs)
$currentname = ($vmtx -split "/|\.")[1]
$vm = new-template -name $currentname -templatefilepath $vmtx -vmhost


ESX 6.0 – The operation is not allowed in the current connection state of the host.


The things in the posting did NOT work. According to IBM’s website, the fix is by removing a package:

esxcli software vib remove -n intel-cdmv2-provider

I got this message when trying to power on a vm, trying to deploy a template, and something else.

So I read this
and then I go to the host and try restarting hostd (/etc/init.d/hostd restart) and it will no longer restart.

Looking into /var/log/hostd.log, it appears that /tmp is full:

2016-02-09T06:01:01.648Z info hostd[79EC2B70] [[email protected] sub=Vimsvc.ha-eventmgr] Event 620 : The ramdisk ‘tmp’ is full.
As a result, the file /tmp/auto-backup.6942719/local.tgz could not be written.

So I look into the /tmp directory and find a file that’s 256MB – cimple_log_err_messages

cat cimple_log_err_messages
2016/02/09 23:28:57:LOG FILE ERROR: log.cpp(610) : No CIMPLE_HOME env var defined. Looking for CIMPLE_HOME
2016/02/09 23:28:57:LOG FILE ERROR: log.cpp(610) : No CIMPLE_HOME env var defined. Looking for CIMPLE_HOME

The first thing I do is to clear up the file – just run:
> cimple_log_err_messages

Then I’m able to start hostd, but how do I stop the file from filling up again?

I find this kb:

Not that it helps! It’s for 5.x. I go to the IBM url and it just leaves me more confused.

I look into disabling CIM. I find instructions here:

ummm it’s for 5.x again. 🙁
Run the instructions and the sfcb watchdog just restarts by itself!

Finally, I poke around in the vSphere client and notice in the profile that there is some CIM stuff there. For the heck of it, I try disallowing communication with IBMIMM.

Screen Shot 2016-02-10 at 11.45.09 AM

I believe the log messages continued after disabling it, so I continued to disable CIM as well. After disabling CIM, the log messages stopped.

Screen Shot 2016-02-29 at 12.14.11 PM


Getting VMware PowerCLI 6 to work on Windows 10

UPDATE: PowerCLI 6.3R1 has been released and fully supports  Windows 10, so there’s no need to do the hack anymore!


PowerCLI 6 is not supported on Windows 10 yet, but I just thought I would give it a try anyway. Upon installation of PowerCLI 6 on Windows 10, I was greeted with this unwelcome screen:


Luckily and very quickly, I found this link:

Just an environment variable. Need to add PSModulePath with “C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules” as the value and reboot.

Screen Shot 2016-02-18 at 12.31.24 PM