Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change date and time in BIOS of virtual machine

I would like to change date in Virtual Machine, but I want to do this by command line. I use this line:

VBoxManage modifyvm MyVirtSystem -biossystemtimeoffset -1209600000

It shoulds change date to two weeks ago, but I get this error message:

VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execu
tion failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or
failed to start.

Have you any ideas what I do wrong?

like image 304
Jacek Avatar asked Jun 23 '13 10:06

Jacek


1 Answers

There are a few things to be aware of when fiddling with the BIOS time offset, the first is that you didn't include a double-dash in your command. I tried it with one of my VMs and I needed to have two dashes for that option to work (though I got a different error than you reported). Here is the command I used:

VBoxManage modifyvm MyVirtSystem --biossystemtimeoffset -1209600000

The next thing is to ensure that you have the proper permissions to modify the xml configuration file for your VM. I have seen many times where VirtualBox is launched after installing with elevated (or even a different user entirely) credentials, a VM is created, and then later without the same privileges a regular user is prohibited from changing the configuration due to file permissions.

One last thing to be aware of, you may you need disable any time sync services, possibly even the guest extensions to prevent the guest clock from getting synchronized back to the correct time. For a Windows guest you would want to stop/disable the VirtulBox Guest Additions and Windows Time services.

like image 187
Goyuix Avatar answered Sep 23 '22 12:09

Goyuix