00 Votes

VirtualBox: Change Date and Time

Tutorial by Anja Proggy | 2014-11-02 at 23:13

If you want to change the time in a guest system in VirtualBox, by default, you can experience the following behavior: After changing the clock of an operating system that was launched from VirtualBox, it does not take long before the time is returning to its original state. It seems as if there is no chance to change the time.

This is due to the automatic time synchronization with the host system. That is, there is always used the computer's time for the virtual machine. But what can you do if you want to run the virtual machine with a different time?

Change Settings from Configuration File

Each virtual machine has two configuration files in which the settings for this machine are specified. You can find the files in the folder in which you have stored the virtual machine and the image of the hard disk.

For example, this can be the directories "C:\Users\<User Name>\VirtualBox VMs\<Name of the Virtual Machine>", "C:\Documents and Settings\<User Name>\.VirtualBox\Machines\" or "C:\Users\<User Name>\.VirtualBox\Machines\<Name of the Virtual Machine>" or, of course, each user defined folder. The files are structured in XML format and have the file extension .vbox and .vbox-prev.

After opening the files in a text editor, you can add (or change) the following line in the section "<ExtraData>". This line configurates whether the time should be taken from the host system.

<ExtraDataItem name="VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" value="1"/>

With setting "value" to "0", the time is synchronized, if "value" is set to "1", there is no synchronization with the host system.

Change Settings via Command Line

Instead of changing the XML configuration files manually using a text editor, you can also perform the changes from the command line. For this, you can enter the following command from the Terminal:

VBoxManage setextradata <Virtual Machine Name> "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"

Of course, you have to insert the name of the virtual machine, you would like to change, into the command.

The tool VBoxManage is located in the installation folder of VirtualBox. So, you have to either run the command directly from the installation folder or you have to specify the full path to VBoxManage to make it work.

Important: Exit VirtualBox before

VirtualBox is reading its settings at startup. Therefore, when applying changes to the configuration, you have to close all running virtual machines as well as VirtualBox itself.

Otherwise, the changes in not becoming activated or they will even be overwritten.

ReplyPositiveNegative

About the Author

AvatarThe author has not added a profile short description yet.
Show Profile

 

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.