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

Multi tool use
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
add a comment |
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
browsershots.org
– ta.speot.is
Jan 22 '13 at 10:00
add a comment |
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
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
windows virtualbox virtual-machine bios time
asked Jan 22 '13 at 9:56
nelaaronelaaro
5,616195790
5,616195790
browsershots.org
– ta.speot.is
Jan 22 '13 at 10:00
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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>
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
add a comment |
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
add a comment |
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
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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>
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
add a comment |
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>
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
add a comment |
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>
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>
edited May 2 '15 at 15:31
Andrea Lazzarotto
682314
682314
answered Jan 22 '13 at 9:59


Stefan SeidelStefan Seidel
7,81711636
7,81711636
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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Jan 12 '17 at 13:10
eliseueliseu
311
311
add a comment |
add a comment |
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
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
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
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
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
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Jan 8 at 16:21
TxaneTxane
1
1
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Txane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
SBTPJPqfv,baYOMiwr1bJNl,4,s 6nURTA 2cPVL4luAkIjwhHn,KYY8ioZBqbV63lrT,X4ta9seb,8EuOMW Bir,Y5sFl6
browsershots.org
– ta.speot.is
Jan 22 '13 at 10:00