Advertisement

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. Turn off your VM.
  2. Open the command prompt. 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.

  3. Type the following command:
    VBoxManage setextradata "My Virtual Machine" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

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

  4. 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 2003-06-06.
    In Windows, open the PowerShell console and type the following command:
    ([datetime]"06/06/2003" - [datetime]::Now)

    windows powershell
    Note the TotalMilliseconds value from the output.

    In Linux, the following script can be used:

    #!/bin/bash
    secs=$(date --date "2003-06-06" +%s)
    let secs-=$(date +%s)
    msecs=$(( $secs * 1000 )) 
    echo $msecs

    Save it as datetime.sh and execute:
    linux terminal

  5. Using the milliseconds value you calculated, execute the following command:
    VBoxManage modifyvm "My Virtual Machine" --biossystemtimeoffset <your milliseconds value>

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

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

17 thoughts on “How to set the BIOS date in VirtualBox”

      1. C:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm “My Virtual Machine” –biossystemtimeoffset This is mine that does it

  1. ## Inicia a VM sempre na data 30/12/2016

    $tempo = “”+([datetime]”12/30/2016” – [datetime]::Now).TotalMilliseconds
    $tempo = “”+[math]::Round($tempo)
    $nome = “nomeVM”

    & ${env:ProgramFiles}\Oracle\VirtualBox\VBoxManage setextradata $nome “VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled” 1

    & ${env:ProgramFiles}\Oracle\VirtualBox\VBoxManage modifyvm $nome –biossystemtimeoffset $tempo

    & ${env:ProgramFiles}\Oracle\VirtualBox\VBoxManage startvm $nome

  2. Just a thank you for these instructions.
    After numerous Googles and many failed attempts (over several years), your guidelines work flawlessly.
    Thank you again.

  3. Hello

    I require my MV to start on January 2017

    My virtual machine is called: W81
    ————————————————– —————————–
    cd c: / Program Files / Oracle / VirtualBox

    VBoxManage setextradata W81 “VBoxInternal / Devices / VMMDev / 0 / Config / GetHostTimeDisabled” 1

    c: \ Program Files \ Oracle \ VirtualBox> VBoxManage modifyvm W81 – biossystemtimeoffset -25477064201

    ————————————————– ——————————–

    After all the procedure, I start my MV but it is dated 2019.

    please help

  4. thanks for this tip and the comments above. been looking for this for so long and the other sites were not as helpful as this.
    i had to confront this finally after almost a year and good thing i found this page. this one hit the sweetspot.

  5. ([datetime]”06/06/2003″ – [datetime]::Now) now working in Win7 PowerShell.

    #!/bin/sh
    secs=$(date –date “2003-06-06” +%s)
    let secs-=$(date +%s)
    msecs=$(( $secs * 1000 ))
    echo $msecs

    Not working on linux. Error “3: let: not found”

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.