Powering on virtual machine from esxcli

If it gets difficult to power on a virtual machine from the vSphere client, vim-cmd offers the possibility to perform this task after connecting on the ESXi host using ssh.

Here are a couple of useful vim-cmd commands:

List all the VMs on the ESXi host:
vim-cmd vmsvc/getallvms

Get VM status using its id:
vim-cmd vmsvc/power.getstate vm_id

Power on a VM using its id:
vim-cmd vmsvc/power.on vm_id

Sources:

https://kb.vmware.com/s/article/1038043

http://nigelhickey.com/power-vm-via-ssh

Pseudo-terminal will not be allocated because stdin is not a terminal

If you need to run a job using cron and this job includes some remote access to Linux servers using ssh, your script may not behave the way you want:

Pseudo-terminal will not be allocated because stdin is not a terminal

The ssh tool provides the option -t.

As per ssh’s manpage:

-t’ Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

If you need to run a sudo command on the remote server, the option -t must be used several times as follows:
ssh -t -t -t -t fool@remote_host "sudo systemctl status apache2"

How to display the current time in a different timezone than yours ?

To quote an example from the Superuser forum:

It’s 6pm in Taipei, what time is it here?

date --date='TZ="Asia/Taipei" 18:00'
Fri Jul 16 11:00:00 BST 2010

At 11am here in London, what time is it in Taipei?

TZ=Asia/Taipei date -d "11:00 BST"
Fri Jul 16 18:00:00 CST 2010

Source: https://superuser.com/questions/164339/timezone-conversion-by-command-line

Could not launch application ‘blueman.desktop’: Unable to start application: Failed to execute child process “blueman-applet” (No such file or directory)

After an upgrade from Debian 9.9 to Debian 10, some errors were found in my .xsessions-errors file.

The apt-file utility provided by the Debian distribution provides an easy way to provide the matching Debian package for a given file.

To install it :

apt install apt-file

To provide it with the latest details from Debian repos :

apt-file update

To look for the corresponding Debian package that blueman.desktop file belongs to :

apt-file search blueman.desktop
blueman: /etc/xdg/autostart/blueman.desktop
blueman: /usr/share/Thunar/sendto/thunar-sendto-blueman.desktop

To install it :

apt install blueman

More details :

Details of apt-file Debian package

Details of blueman Debian package

Could not launch application ‘hplip-systray.desktop’: Unable to start application: Failed to execute child process “hp-systray” (No such fil e or directory)

After an upgrade from Debian 9.9 to Debian 10, some errors were found in my .xsessions-errors file.

The apt-file utility provided by the Debian distribution provides an easy way to provide the matching Debian package for a given file.

To install it :

apt install apt-file

To provide it with the latest details from Debian repos :

apt-file update

To look for the corresponding Debian package that hplip-systray.desktop file belongs to :

apt-file search hplip-systray.desktop
hplip-gui: /etc/xdg/autostart/hplip-systray.desktop

To install it :

apt install hplip-gui

More details :

Details of apt-file Debian package

Details of hplip-gui Debian package

To detect whether software based rendering is needed for Qt 5 the glxinfo program is a requirement but it was not found on this system.

After an upgrade from Debian 9.9 to Debian 10, some errors were found in my .xsessions-errors file.

To detect whether software based rendering is needed for Qt 5 the glxinfo program is a requirement but it was not found on this system.

The glxinfo program is provided by the mesa-utils Debian package.

To install it :

apt install mesa-utils

More details : Details of mesa-utils Debian package