Setting up JAVA_HOME on Window

The JAVA_HOME variable should point to the JDK’s bin folder in order for Java applications (jar, war, etc) to know where Java lives.

To setup a JAVA_HOME environment variable on Windows.

  • Right click on the My Computer icon in the start menu or on the desktop and select properties
  • Click the Advanced Tab
  • Click the Environment Variables button
  • Under System Variable, click New
  • Enter the variable name as JAVA_HOME
  • Enter the variable value as the install path for the Development Kit
  • Click OK
  • Click Apply Changes

Word of caution, Java is not fond of spaces, so I use pathnames without spaces.

Note: You will need to click OK, apply changes AND reload cmd to see the changes there.

VBoxManage controlvm reset & poweroff

When you are running for instance a headless host machine it is sometimes needed to turn it off or to restart it from outside the host (for instance as part of a script or if the host is not accessible, no rdp etc).

Word of caution: These operations stops the machine dead in its tracks, any unsaved data is lost!

To turn it off (equivalent of pulling the power cable):

VBoxManage controlvm <vm> poweroff

Note: can be either the registred machine name or the UID of the host

To restart it (equivalent of pushing the reset button):

VBoxManage controlvm <vm> restart

Note: can be either the registred machine name or the UID of the host

For more details, here is what the manual (4.1.2) says:

  • VBoxManage controlvm reset has the same effect on a virtual machine as pressing the “Reset” button on a real computer: a cold reboot of the virtual machine, which will restart and boot the guest operating system again immediately. The state of the VM is not saved beforehand, and data may be lost. (This is equivalent to selecting the “Reset” item in the “Machine” menu of the GUI.)
  • VBoxManage controlvm poweroff has the same effect on a virtual machine as pulling the power cable on a real computer. Again, the state of the VM is not saved beforehand, and data may be lost. (This is equivalent to selecting the “Close” item in the “Machine” menu of the GUI or pressing the window’s close button, and then selecting “Power off the machine” in the dialog.)
    After this, the VM’s state will be “Powered off”. From there, it can be started again; see chapter 8.11, VBoxManage startvm