Some basic XenServer VM management from the CLI / command line

List some VMs we care about:
================================================

Take snapshot of the VMs
================================================

Start the VMs
================================================

Stop the VMs
================================================

Shutdown – Take snapshot – Start sequence:
================================================
On one line:

For use in a short shell script (prettier formatting):

Import VMs from directory:
================================================

Export VMs to current directory:
================================================

Error when installing the vSphere6.0 appliance: The file D:\vcsa-setup.html is not in a folder shared with the host and cannot be opened by the host.

When trying to launch the vSphere6.0 appliance installer I just got the following “The file D:\vcsa-setup.html is not in a folder shared with the host and cannot be opened by the host.”

vcsa-setup.html error

After having tried and received the same error after copying the ISO locally, emptying the contents into a folder, mounting it via vCenter5.5 to my VM, etc I simply dragged and dropped the file onto Firefox. That was it – it works.

Funny how these simple things can end up wasting time …

Mount encrypted QNAP disk (crypto_LUKS) on an external computer

To mount and read data from a disk encrypted with crypto_LUKS (for example from a QNAP backup), use cryptsetup as per the below:

Install cryptsetup if not already installed:

Unlock the disk (in this case /dev/sdb1 – adjust based on the device you wish to unlock). Select a good name for the unlocked disk. In this case we use “cryptodisk” but any name will work:

The disk will be listed under /dev/mapper/. In this case /dev/mapper/cryptodisk:

Now data can be accessed as normal via the mount point /home/user/mount/usb/

To unmount, do the following:

Finally lock the disk:
sudo cryptsetup luksClose cryptodisk[/code]

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