Set the 'bios' time of the virtual box.
Set the 'bios' time of the virtual box.
Under a linux host, I have a need to install XP and set it back in time from the start. Unfortunately, whatever I've been trying with Windows, it always gets back to the time settings of the host.
Since I was careful to uncheck the internet time server synchro, I guess XP sets its time directly from what it extracts from the bios.
Is there a way to set the virtual bios to a chosen date?
Since I was careful to uncheck the internet time server synchro, I guess XP sets its time directly from what it extracts from the bios.
Is there a way to set the virtual bios to a chosen date?
-
- Volunteer
- Posts: 180
- Joined: 17. May 2007, 16:02
You misunderstand me. I don't want the virtual XP time to be correct, I want it to be set on whatever I choose it to be.
I just realized that among the additions there's a sync tool. That don't help, on the contrary.
So my question becomes: Is there a way to set the virtual bios time on a time and date of my choice, and can I have the additions installed with that sync tool deactivated somehow?
I just realized that among the additions there's a sync tool. That don't help, on the contrary.
So my question becomes: Is there a way to set the virtual bios time on a time and date of my choice, and can I have the additions installed with that sync tool deactivated somehow?
You can set a time offset in VBox 1.4.0:
Code: Select all
VBoxManage modifyvm <name> -biossystemtimeoffset <msec>
Thanks. That's exactly the kind of thing I was looking for - but knowing I have to set it back about 2 years in millisecond .
It isn't really documented in the user manual though. I could only find it mentionned at the beginning of the quick reference section: to set it back in time, do I just have to use it with a minus in front?
It isn't really documented in the user manual though. I could only find it mentionned at the beginning of the quick reference section: to set it back in time, do I just have to use it with a minus in front?
Code: Select all
VBoxManage modifyvm <name> -biossystemtimeoffset <-msec>
When I posted my question there were 12 days left in September. what about next week, what about next month, ...? In short: I was hoping for something generic. Something like the following:
Sorry, but I can't help anyone on Windows.
Code: Select all
vboxdate () {
# Adjust VM BIOS time to a given date
secs=$(date –date "$*" +%s) # convert supplied date to secs, since 1970-01-01
let secs-=$(date +%s) # subtract the date NOW
msecs=$(( $secs * 1000 )) # convert to millis
echo Adjusting time ${msecs}ms
VBoxManage modifyvm Vista -biossystemtimeoffset ${msecs};
}
-
- Posts: 1
- Joined: 27. Sep 2008, 12:23
-
- Posts: 1
- Joined: 10. Oct 2008, 21:49
Handy Perl script
Here's a perl script I use. You may not have the Date::Manip module in your distribution, but you can get it from http://search.cpan.org/search?query=Dat ... p&mode=all
HB
Code: Select all
#!/usr/bin/perl -w
use strict;
use Date::Manip;
my $start = join(' ', @ARGV);
my $sdate = ParseDate($start);
my $edate = ParseDate("now");
my $sepoch = UnixDate($sdate, "%s");
my $eepoch = UnixDate($edate, "%s");
my $msec = -1000 * ($eepoch - $sepoch);
print "Something like:\nVBoxManage modifyvm <name> -biossystemtimeoffset $msec\n";
Date::Manip has awesome parsing:$ perl msec.pl 6:30 PM 27 august 2003
Something like:
VBoxManage modifyvm <name> -biossystemtimeoffset -161636563000
$
If you get "Use of uninitialized value in subtraction (-) at msec.pl line 11.", you've gone past Date::Manip's awesomeness:$ perl msec.pl 2 days ago
Something like:
VBoxManage modifyvm <name> -biossystemtimeoffset -172800000
$
Cheers,$ perl msec.pl next year
Use of uninitialized value in subtraction (-) at msec.pl line 11.
Something like:
VBoxManage modifyvm <name> -biossystemtimeoffset -1223670094000
$
HB
How To Set The Virtual Bios Date Manually?
Hi Folks,
The examples I've seen in the forum, seem to require programming an instruction into a php program or the like, then running that program. I am not familiar with that environment, so I cannot use that procedure.
Is there any way I can set the date manually?
Regards,
Gungadout
The examples I've seen in the forum, seem to require programming an instruction into a php program or the like, then running that program. I am not familiar with that environment, so I cannot use that procedure.
Is there any way I can set the date manually?
Regards,
Gungadout
-
- Posts: 2
- Joined: 16. Jun 2009, 10:57
- Primary OS: MS Windows XP
- VBox Version: OSE other
- Guest OSses: Win XP
Re: Set the 'bios' time of the virtual box.
hello, I agree with "gungadout"! Why isn`t there any simple way to freeze the time of a VM? Even if you end the Windows service W32time and uncheck time synchronisation with microsoft server the time is synchronisized...but fromthe bios? isn´t the bios freezed too like the operating system?
Re: Set the 'bios' time of the virtual box.
Time is kept ontime by the Guest Additions, remove them to set your own time.
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-