Using virtual box is it possible to set your virtual machine time to be different from host time












32















Using virtual box is it possible to set your virtual machine time to be different from host time. Say 1 year into the past.



If I wanted to run the windows XP images provided by Microsoft from here.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11575



It is noted for the XP image that:



Expires: This image will shutdown and become completely unusable on February 14, 2013.



It is one of the better ways to test IE 6, and IE 7. Other XP typical tests.










share|improve this question























  • browsershots.org

    – ta.speot.is
    Jan 22 '13 at 10:00
















32















Using virtual box is it possible to set your virtual machine time to be different from host time. Say 1 year into the past.



If I wanted to run the windows XP images provided by Microsoft from here.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11575



It is noted for the XP image that:



Expires: This image will shutdown and become completely unusable on February 14, 2013.



It is one of the better ways to test IE 6, and IE 7. Other XP typical tests.










share|improve this question























  • browsershots.org

    – ta.speot.is
    Jan 22 '13 at 10:00














32












32








32


14






Using virtual box is it possible to set your virtual machine time to be different from host time. Say 1 year into the past.



If I wanted to run the windows XP images provided by Microsoft from here.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11575



It is noted for the XP image that:



Expires: This image will shutdown and become completely unusable on February 14, 2013.



It is one of the better ways to test IE 6, and IE 7. Other XP typical tests.










share|improve this question














Using virtual box is it possible to set your virtual machine time to be different from host time. Say 1 year into the past.



If I wanted to run the windows XP images provided by Microsoft from here.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11575



It is noted for the XP image that:



Expires: This image will shutdown and become completely unusable on February 14, 2013.



It is one of the better ways to test IE 6, and IE 7. Other XP typical tests.







windows virtualbox virtual-machine bios time






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 22 '13 at 9:56









nelaaronelaaro

5,706215790




5,706215790













  • browsershots.org

    – ta.speot.is
    Jan 22 '13 at 10:00



















  • browsershots.org

    – ta.speot.is
    Jan 22 '13 at 10:00

















browsershots.org

– ta.speot.is
Jan 22 '13 at 10:00





browsershots.org

– ta.speot.is
Jan 22 '13 at 10:00










3 Answers
3






active

oldest

votes


















37














It's no problem at all. Just remember to disable the time synchronisation in the VirtualBox Guest Additions, then set the date+time in the virtual machine as you like. There is also an option to go into the Virtual BIOS and set the date+time there, if that's needed at install time.



This command disables the synchronization:
http://www.virtualbox.org/manual/ch09.html#disabletimesync



VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1


The following option allows to set an offset in milliseconds:
http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm



VBoxManage modifyvm "VM name" --biossystemtimeoffset <msec>





share|improve this answer


























  • Ok how do you do that.

    – nelaaro
    Jan 22 '13 at 10:03











  • Do what? Please be more specific?

    – Stefan Seidel
    Jan 22 '13 at 10:29






  • 3





    disable the time synchronisation & go into the Virtual BIOS and set the date+time there

    – nelaaro
    Jan 22 '13 at 10:31






  • 2





    Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

    – Stefan Seidel
    Jan 22 '13 at 11:32





















3














Example of a windows powerShell script



startVM.ps1



# Starts the VM always on the date 12/30/2016

$tempo = ""+([datetime]"12/30/2016" - [datetime]::Now).TotalMilliseconds
$tempo = ""+[math]::Round($tempo)
$nome = "virtualMachineName"

& ${env:ProgramFiles}OracleVirtualBoxVBoxManage setextradata $nome "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

& ${env:ProgramFiles}OracleVirtualBoxVBoxManage modifyvm $nome --biossystemtimeoffset $tempo

& ${env:ProgramFiles}OracleVirtualBoxVBoxManage startvm $nome





share|improve this answer































    0














    Based on the ".ps1" (Windows PowerShell script) example above, I've written a regular ".bat" script file to change the clock time at which the VirtualBox's virtual machine starts.



    The desired start time is set at variable "TEMPO_START_TIMESTAMP" in epoch format. You can get your desired start time epoh equivalent at "http://www.timestampconvert.com/".



    The name of the VirtualBox's virtual machine to be started is needed in variable "NOME" (same nomenchature used in the ".ps1" script above).



    echo off
    echo %time%

    set NOME="Windows_7_x64"

    set TEMPO_CS_2_MS=0
    set TEMPO_S_2_MS=000

    rem # Starts the VM always on the date 07/11/2014 - 11h58
    rem http://www.timestampconvert.com/

    set TEMPO_START_TIMESTAMP=1415361480

    for /f "delims=" %%x in ('cscript /nologo toEpoch.vbs') do set epoch=%%x
    rem %epoch%

    set TEMPO_CURRENT_TIMESTAMP=%epoch%
    rem set TEMPO_CURRENT_TIMESTAMP=1544518714

    set /A TEMPO_TEMP=(%TEMPO_START_TIMESTAMP%-%TEMPO_CURRENT_TIMESTAMP%)

    call set TEMPO=%TEMPO_TEMP%%TEMPO_S_2_MS%
    rem %TEMPO_TEMP%
    rem %TEMPO%

    c:Progra~1OracleVirtualBoxVBoxManage setextradata %NOME% "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
    c:Progra~1OracleVirtualBoxVBoxManage modifyvm %NOME% --biossystemtimeoffset %TEMPO%
    c:Progra~1OracleVirtualBoxVBoxManage startvm %NOME%


    You'll also need the current time in epoh format, for this use the following script (save as "toEpoch.vbs", this visual basic script is called from the ".bat" script above):



    WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now())


    To run the virtual machine, simply execute the ".bat" script file above. No need to open the "Oracle VM VirtualBox Administration" interface.



    I hope this helps.



    Regards






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f539880%2fusing-virtual-box-is-it-possible-to-set-your-virtual-machine-time-to-be-differen%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      37














      It's no problem at all. Just remember to disable the time synchronisation in the VirtualBox Guest Additions, then set the date+time in the virtual machine as you like. There is also an option to go into the Virtual BIOS and set the date+time there, if that's needed at install time.



      This command disables the synchronization:
      http://www.virtualbox.org/manual/ch09.html#disabletimesync



      VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1


      The following option allows to set an offset in milliseconds:
      http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm



      VBoxManage modifyvm "VM name" --biossystemtimeoffset <msec>





      share|improve this answer


























      • Ok how do you do that.

        – nelaaro
        Jan 22 '13 at 10:03











      • Do what? Please be more specific?

        – Stefan Seidel
        Jan 22 '13 at 10:29






      • 3





        disable the time synchronisation & go into the Virtual BIOS and set the date+time there

        – nelaaro
        Jan 22 '13 at 10:31






      • 2





        Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

        – Stefan Seidel
        Jan 22 '13 at 11:32


















      37














      It's no problem at all. Just remember to disable the time synchronisation in the VirtualBox Guest Additions, then set the date+time in the virtual machine as you like. There is also an option to go into the Virtual BIOS and set the date+time there, if that's needed at install time.



      This command disables the synchronization:
      http://www.virtualbox.org/manual/ch09.html#disabletimesync



      VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1


      The following option allows to set an offset in milliseconds:
      http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm



      VBoxManage modifyvm "VM name" --biossystemtimeoffset <msec>





      share|improve this answer


























      • Ok how do you do that.

        – nelaaro
        Jan 22 '13 at 10:03











      • Do what? Please be more specific?

        – Stefan Seidel
        Jan 22 '13 at 10:29






      • 3





        disable the time synchronisation & go into the Virtual BIOS and set the date+time there

        – nelaaro
        Jan 22 '13 at 10:31






      • 2





        Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

        – Stefan Seidel
        Jan 22 '13 at 11:32
















      37












      37








      37







      It's no problem at all. Just remember to disable the time synchronisation in the VirtualBox Guest Additions, then set the date+time in the virtual machine as you like. There is also an option to go into the Virtual BIOS and set the date+time there, if that's needed at install time.



      This command disables the synchronization:
      http://www.virtualbox.org/manual/ch09.html#disabletimesync



      VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1


      The following option allows to set an offset in milliseconds:
      http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm



      VBoxManage modifyvm "VM name" --biossystemtimeoffset <msec>





      share|improve this answer















      It's no problem at all. Just remember to disable the time synchronisation in the VirtualBox Guest Additions, then set the date+time in the virtual machine as you like. There is also an option to go into the Virtual BIOS and set the date+time there, if that's needed at install time.



      This command disables the synchronization:
      http://www.virtualbox.org/manual/ch09.html#disabletimesync



      VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1


      The following option allows to set an offset in milliseconds:
      http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm



      VBoxManage modifyvm "VM name" --biossystemtimeoffset <msec>






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited May 2 '15 at 15:31









      Andrea Lazzarotto

      682314




      682314










      answered Jan 22 '13 at 9:59









      Stefan SeidelStefan Seidel

      7,89711637




      7,89711637













      • Ok how do you do that.

        – nelaaro
        Jan 22 '13 at 10:03











      • Do what? Please be more specific?

        – Stefan Seidel
        Jan 22 '13 at 10:29






      • 3





        disable the time synchronisation & go into the Virtual BIOS and set the date+time there

        – nelaaro
        Jan 22 '13 at 10:31






      • 2





        Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

        – Stefan Seidel
        Jan 22 '13 at 11:32





















      • Ok how do you do that.

        – nelaaro
        Jan 22 '13 at 10:03











      • Do what? Please be more specific?

        – Stefan Seidel
        Jan 22 '13 at 10:29






      • 3





        disable the time synchronisation & go into the Virtual BIOS and set the date+time there

        – nelaaro
        Jan 22 '13 at 10:31






      • 2





        Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

        – Stefan Seidel
        Jan 22 '13 at 11:32



















      Ok how do you do that.

      – nelaaro
      Jan 22 '13 at 10:03





      Ok how do you do that.

      – nelaaro
      Jan 22 '13 at 10:03













      Do what? Please be more specific?

      – Stefan Seidel
      Jan 22 '13 at 10:29





      Do what? Please be more specific?

      – Stefan Seidel
      Jan 22 '13 at 10:29




      3




      3





      disable the time synchronisation & go into the Virtual BIOS and set the date+time there

      – nelaaro
      Jan 22 '13 at 10:31





      disable the time synchronisation & go into the Virtual BIOS and set the date+time there

      – nelaaro
      Jan 22 '13 at 10:31




      2




      2





      Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

      – Stefan Seidel
      Jan 22 '13 at 11:32







      Disable time sync: there's a checkbox in the VirtualBox Guest Additional. Alternatively: virtualbox.org/manual/ch09.html#disabletimesync For the BIOS: hit F12 (I think) during the VM startup, and here are command line tools described: betaarchive.com/forum/viewtopic.php?t=20071 on how to change the BIOS time.

      – Stefan Seidel
      Jan 22 '13 at 11:32















      3














      Example of a windows powerShell script



      startVM.ps1



      # Starts the VM always on the date 12/30/2016

      $tempo = ""+([datetime]"12/30/2016" - [datetime]::Now).TotalMilliseconds
      $tempo = ""+[math]::Round($tempo)
      $nome = "virtualMachineName"

      & ${env:ProgramFiles}OracleVirtualBoxVBoxManage setextradata $nome "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

      & ${env:ProgramFiles}OracleVirtualBoxVBoxManage modifyvm $nome --biossystemtimeoffset $tempo

      & ${env:ProgramFiles}OracleVirtualBoxVBoxManage startvm $nome





      share|improve this answer




























        3














        Example of a windows powerShell script



        startVM.ps1



        # Starts the VM always on the date 12/30/2016

        $tempo = ""+([datetime]"12/30/2016" - [datetime]::Now).TotalMilliseconds
        $tempo = ""+[math]::Round($tempo)
        $nome = "virtualMachineName"

        & ${env:ProgramFiles}OracleVirtualBoxVBoxManage setextradata $nome "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

        & ${env:ProgramFiles}OracleVirtualBoxVBoxManage modifyvm $nome --biossystemtimeoffset $tempo

        & ${env:ProgramFiles}OracleVirtualBoxVBoxManage startvm $nome





        share|improve this answer


























          3












          3








          3







          Example of a windows powerShell script



          startVM.ps1



          # Starts the VM always on the date 12/30/2016

          $tempo = ""+([datetime]"12/30/2016" - [datetime]::Now).TotalMilliseconds
          $tempo = ""+[math]::Round($tempo)
          $nome = "virtualMachineName"

          & ${env:ProgramFiles}OracleVirtualBoxVBoxManage setextradata $nome "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

          & ${env:ProgramFiles}OracleVirtualBoxVBoxManage modifyvm $nome --biossystemtimeoffset $tempo

          & ${env:ProgramFiles}OracleVirtualBoxVBoxManage startvm $nome





          share|improve this answer













          Example of a windows powerShell script



          startVM.ps1



          # Starts the VM always on the date 12/30/2016

          $tempo = ""+([datetime]"12/30/2016" - [datetime]::Now).TotalMilliseconds
          $tempo = ""+[math]::Round($tempo)
          $nome = "virtualMachineName"

          & ${env:ProgramFiles}OracleVirtualBoxVBoxManage setextradata $nome "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

          & ${env:ProgramFiles}OracleVirtualBoxVBoxManage modifyvm $nome --biossystemtimeoffset $tempo

          & ${env:ProgramFiles}OracleVirtualBoxVBoxManage startvm $nome






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 12 '17 at 13:10









          eliseueliseu

          311




          311























              0














              Based on the ".ps1" (Windows PowerShell script) example above, I've written a regular ".bat" script file to change the clock time at which the VirtualBox's virtual machine starts.



              The desired start time is set at variable "TEMPO_START_TIMESTAMP" in epoch format. You can get your desired start time epoh equivalent at "http://www.timestampconvert.com/".



              The name of the VirtualBox's virtual machine to be started is needed in variable "NOME" (same nomenchature used in the ".ps1" script above).



              echo off
              echo %time%

              set NOME="Windows_7_x64"

              set TEMPO_CS_2_MS=0
              set TEMPO_S_2_MS=000

              rem # Starts the VM always on the date 07/11/2014 - 11h58
              rem http://www.timestampconvert.com/

              set TEMPO_START_TIMESTAMP=1415361480

              for /f "delims=" %%x in ('cscript /nologo toEpoch.vbs') do set epoch=%%x
              rem %epoch%

              set TEMPO_CURRENT_TIMESTAMP=%epoch%
              rem set TEMPO_CURRENT_TIMESTAMP=1544518714

              set /A TEMPO_TEMP=(%TEMPO_START_TIMESTAMP%-%TEMPO_CURRENT_TIMESTAMP%)

              call set TEMPO=%TEMPO_TEMP%%TEMPO_S_2_MS%
              rem %TEMPO_TEMP%
              rem %TEMPO%

              c:Progra~1OracleVirtualBoxVBoxManage setextradata %NOME% "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
              c:Progra~1OracleVirtualBoxVBoxManage modifyvm %NOME% --biossystemtimeoffset %TEMPO%
              c:Progra~1OracleVirtualBoxVBoxManage startvm %NOME%


              You'll also need the current time in epoh format, for this use the following script (save as "toEpoch.vbs", this visual basic script is called from the ".bat" script above):



              WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now())


              To run the virtual machine, simply execute the ".bat" script file above. No need to open the "Oracle VM VirtualBox Administration" interface.



              I hope this helps.



              Regards






              share|improve this answer




























                0














                Based on the ".ps1" (Windows PowerShell script) example above, I've written a regular ".bat" script file to change the clock time at which the VirtualBox's virtual machine starts.



                The desired start time is set at variable "TEMPO_START_TIMESTAMP" in epoch format. You can get your desired start time epoh equivalent at "http://www.timestampconvert.com/".



                The name of the VirtualBox's virtual machine to be started is needed in variable "NOME" (same nomenchature used in the ".ps1" script above).



                echo off
                echo %time%

                set NOME="Windows_7_x64"

                set TEMPO_CS_2_MS=0
                set TEMPO_S_2_MS=000

                rem # Starts the VM always on the date 07/11/2014 - 11h58
                rem http://www.timestampconvert.com/

                set TEMPO_START_TIMESTAMP=1415361480

                for /f "delims=" %%x in ('cscript /nologo toEpoch.vbs') do set epoch=%%x
                rem %epoch%

                set TEMPO_CURRENT_TIMESTAMP=%epoch%
                rem set TEMPO_CURRENT_TIMESTAMP=1544518714

                set /A TEMPO_TEMP=(%TEMPO_START_TIMESTAMP%-%TEMPO_CURRENT_TIMESTAMP%)

                call set TEMPO=%TEMPO_TEMP%%TEMPO_S_2_MS%
                rem %TEMPO_TEMP%
                rem %TEMPO%

                c:Progra~1OracleVirtualBoxVBoxManage setextradata %NOME% "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
                c:Progra~1OracleVirtualBoxVBoxManage modifyvm %NOME% --biossystemtimeoffset %TEMPO%
                c:Progra~1OracleVirtualBoxVBoxManage startvm %NOME%


                You'll also need the current time in epoh format, for this use the following script (save as "toEpoch.vbs", this visual basic script is called from the ".bat" script above):



                WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now())


                To run the virtual machine, simply execute the ".bat" script file above. No need to open the "Oracle VM VirtualBox Administration" interface.



                I hope this helps.



                Regards






                share|improve this answer


























                  0












                  0








                  0







                  Based on the ".ps1" (Windows PowerShell script) example above, I've written a regular ".bat" script file to change the clock time at which the VirtualBox's virtual machine starts.



                  The desired start time is set at variable "TEMPO_START_TIMESTAMP" in epoch format. You can get your desired start time epoh equivalent at "http://www.timestampconvert.com/".



                  The name of the VirtualBox's virtual machine to be started is needed in variable "NOME" (same nomenchature used in the ".ps1" script above).



                  echo off
                  echo %time%

                  set NOME="Windows_7_x64"

                  set TEMPO_CS_2_MS=0
                  set TEMPO_S_2_MS=000

                  rem # Starts the VM always on the date 07/11/2014 - 11h58
                  rem http://www.timestampconvert.com/

                  set TEMPO_START_TIMESTAMP=1415361480

                  for /f "delims=" %%x in ('cscript /nologo toEpoch.vbs') do set epoch=%%x
                  rem %epoch%

                  set TEMPO_CURRENT_TIMESTAMP=%epoch%
                  rem set TEMPO_CURRENT_TIMESTAMP=1544518714

                  set /A TEMPO_TEMP=(%TEMPO_START_TIMESTAMP%-%TEMPO_CURRENT_TIMESTAMP%)

                  call set TEMPO=%TEMPO_TEMP%%TEMPO_S_2_MS%
                  rem %TEMPO_TEMP%
                  rem %TEMPO%

                  c:Progra~1OracleVirtualBoxVBoxManage setextradata %NOME% "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
                  c:Progra~1OracleVirtualBoxVBoxManage modifyvm %NOME% --biossystemtimeoffset %TEMPO%
                  c:Progra~1OracleVirtualBoxVBoxManage startvm %NOME%


                  You'll also need the current time in epoh format, for this use the following script (save as "toEpoch.vbs", this visual basic script is called from the ".bat" script above):



                  WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now())


                  To run the virtual machine, simply execute the ".bat" script file above. No need to open the "Oracle VM VirtualBox Administration" interface.



                  I hope this helps.



                  Regards






                  share|improve this answer













                  Based on the ".ps1" (Windows PowerShell script) example above, I've written a regular ".bat" script file to change the clock time at which the VirtualBox's virtual machine starts.



                  The desired start time is set at variable "TEMPO_START_TIMESTAMP" in epoch format. You can get your desired start time epoh equivalent at "http://www.timestampconvert.com/".



                  The name of the VirtualBox's virtual machine to be started is needed in variable "NOME" (same nomenchature used in the ".ps1" script above).



                  echo off
                  echo %time%

                  set NOME="Windows_7_x64"

                  set TEMPO_CS_2_MS=0
                  set TEMPO_S_2_MS=000

                  rem # Starts the VM always on the date 07/11/2014 - 11h58
                  rem http://www.timestampconvert.com/

                  set TEMPO_START_TIMESTAMP=1415361480

                  for /f "delims=" %%x in ('cscript /nologo toEpoch.vbs') do set epoch=%%x
                  rem %epoch%

                  set TEMPO_CURRENT_TIMESTAMP=%epoch%
                  rem set TEMPO_CURRENT_TIMESTAMP=1544518714

                  set /A TEMPO_TEMP=(%TEMPO_START_TIMESTAMP%-%TEMPO_CURRENT_TIMESTAMP%)

                  call set TEMPO=%TEMPO_TEMP%%TEMPO_S_2_MS%
                  rem %TEMPO_TEMP%
                  rem %TEMPO%

                  c:Progra~1OracleVirtualBoxVBoxManage setextradata %NOME% "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
                  c:Progra~1OracleVirtualBoxVBoxManage modifyvm %NOME% --biossystemtimeoffset %TEMPO%
                  c:Progra~1OracleVirtualBoxVBoxManage startvm %NOME%


                  You'll also need the current time in epoh format, for this use the following script (save as "toEpoch.vbs", this visual basic script is called from the ".bat" script above):



                  WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now())


                  To run the virtual machine, simply execute the ".bat" script file above. No need to open the "Oracle VM VirtualBox Administration" interface.



                  I hope this helps.



                  Regards







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 8 at 16:21









                  TxaneTxane

                  1




                  1






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f539880%2fusing-virtual-box-is-it-possible-to-set-your-virtual-machine-time-to-be-differen%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Plaza Victoria

                      In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                      How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...