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)


    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:

  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!

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

  1. 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
      1. thatguy

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

        Reply
  2. 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
  3. 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
  4. 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
  5. DavidE

    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.

    Reply
  6. Maryan Srakinson

    ([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”

    Reply
    1. Sergey Tkachenko Post author

      Let is a built-in function of the bash shell.
      I guess you (and me) need to change the first line of the script from #!/bin/sh to #!/bin/bash
      Please try to modify and re-run it.

      Reply

Leave a Reply

Your email address will not be published.