Stopping X windows / dropping to single-user mode

Installing the NVIDIA driver on Linux requires dropping to a command prompt without X windows running in the background.

Switch to root user:

Stop the window manager:

After this X windows will stop and a command prompt will be displayed. The option to enter the root password will be given. Enter it and then install the driver as root. To install the driver, do one of the following:

Option 1:

Option 2:

When done, start X windows again with:
/etc/init.d/gdm3 start

Connect ISO file to server using RACADM

Using VNC to connect to the iDRAC of a server is a great way to avoid Oracles eternal Java upgrades, security flaws, etc. At the other hand the Java viewer allows for mapping of ISO files when installing the server OS. That’s not an option with VNC, so what to do? Easy: Launch the VNC session and map the ISO file separately from the command line:

Check status of virtual media:

Mount the image:

Verify that the image is connected:

Disconnect the image:

Power control of VMs on ESXi using a script on the command line

Automating VM power control over the command line can be very useful. Especially to simplify test scenarios when tens or hundreds of VM’s are used. A couple of simple examples below.

Unfortunately the commands for powering on and off are completely different. This means we have two separate scripts for each task:

Powering on:
List all VM’s so we can find the ones we want:

Grep for the ones we are interested in:

Print only their IDs:

Because we’re pedantic – sort them in correct order – just in case:

Run a loop to power them on:

Powering off:
List all the processes:
By default esxcli lists the information on separate lines which makes scripting close to impossible. Therefore we use the –formatter option to list the output in CSV format.

To enable AWK we replace spaces with % (for example) and commas with spaces:

Grep for the VMs we want to power off:

Print only the world-id’s:

Run it in a loop:

Windows 2012R2 – Extend disk: “There is not enough space available on the disk(s) to complete this operation.”

I needed to extend the main storage of my fileserver this morning. While VMware happily extended the storage volume for the VM when I asked it to, Windows 2012 R2 was not so helpful. Luckily this is easily fixed.

In Disk Manager (diskmgmt.msc) make sure the disk to be extended is set to be “Dynamic”. If it is, simply Re-scan the disks. Now it can be extended just fine. Screenshots below:

Error when extending disk:


Rescan disks:


Disk extended to use the extra space: