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/sh
    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.

9 thoughts on “How to set the BIOS date in VirtualBox

  1. vicsar

    Thanks. Very useful.

    Reply
  2. Bobby

    Does not work. Copied and pasted directly from here, replacing what is needed, but the syntax of the command is wrong.

    Reply
    1. Sergey Tkachenko Post author

      Which command exactly has wrong syntax?
      I used everything written above weekly. All commands are correct.

      Reply
  3. ELISEU RODRIGUES MENEZES

    ## 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

    Reply
  4. tom

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

    Reply
  5. pat

    Thank you, step 3 is all what i need

    Reply
  6. Carlos Goncalves

    Hello.. And what is necessary to do to set the current time?

    Reply
  7. Cristian Pachon

    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

    Reply
    1. Sergey Tkachenko Post author

      how did you get the offset value?

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.