Sie sind auf Seite 1von 2

How to set the BIOS date in VirtualBox

VirtualBox is my virtualization software of choice. It is free and feature-rich, so all my virtual


machines are created in VirtualBox. In this article, we will see how to set the BIOS date for a
VirtualBox VM.

You might have a number of reasons to set a custom date for a VirtualBox VM. For example, when
you want to try some outdated Windows build or some time-limited trial software. By default,
VirtualBox uses the host machine's time and date and synchronizes it when you open your VM.
To set a custom date, you need to perform these steps:

1. Disable the clock’s “Automatic sync with a Time server” inside the OS
2. Turn off your VM.
3. Open the command prompt as Administrator. If you are using Windows, open it in the
following folder:

C:\Program Files\Oracle\VirtualBox

If you are using Linux, just open the terminal app.

4. Type the following command:

VBoxManage setextradata "My Virtual Machine"


"VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

Es.: VBoxManage setextradata "WinXP_Mode2"


"VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

Replace the "My Virtual Machine" string with the actual name of the virtual machine you
are using.

5. Now, you need to calculate the offset between the current date and the desired BIOS date
for the VM, in milliseconds.
For example, let's set it to 2019-01-01.
In Windows, open the PowerShell console and type the following command:

([datetime]"01/01/2019" - [datetime]::Now)

Note the TotalMilliseconds value from the output, and keep the integer part with the sign.
In our example “-174190590“

https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/
In Linux, the following script can be used:

#!/bin/sh
secs=$(date --date "2019-01-01" +%s)
let secs-=$(date +%s)
msecs=$(( $secs * 1000 ))
echo $msecs

Save it as datetime.sh and execute:

6. Using the milliseconds value you calculated, execute the following command:

VBoxManage modifyvm "My Virtual Machine" --biossystemtimeoffset <your


milliseconds value>

Es. VBoxManage modifyvm "WinXP_Mode2" --biossystemtimeoffset -174190590

Now you can start your VM. Its BIOS date will be 2019-01-01 and will not be set from the host OS
any more.

https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/

Das könnte Ihnen auch gefallen