2012年7月21日土曜日

create a custom BIOS file

https://www.virtualbox.org/pipermail/vbox-dev/2011-June/004179.html

You can create a custom BIOS file, and then patch the last few bytes, and attach the patched bios file to the VM.    1) Get to a command prompt in the VM, and run these commands in the VM to capture the VirtualBox BIOS:    C:\>debug  r cs  eff0  r bx  1  n bios.bin  w  q    Here they are again with comments:  C:\>debug    [This runs debug.exe, a primitive MS supplied debugger.  It should be present on your Win98 system]  r cs    [This command says Let me set the CS register, debug.exe will display the current CS and then a ':' prompt]  eff0    [This sets the CS register to hex EFF0, which is hex 100 bytes before the BIOS at F000]  r bx    [This command says let me set the BX register, debug displayed the cirrent BX then a ':' prompt]  1        [This sets the BX register  to 1 (digit ONE)]  n bios.bin    [This says set the fileName to "bios.bin"]  w        [This writes BX:CX bytes (hex 10000 = dec 65536 bytes), starting at EFF0:100]  q        [Quit]    You should now have a file bios.bin, which is the VirtualBox bios, dumped.    2) Use whatever tool you feel comfortable with to patch the file.  Make sure it can edit binary files without mangling them.  Perhaps use DOS fc/b command to compare before and after editing.    These commands, if CAREFULLY entered, will enable you to edit the file.    C:\>copy bios.bin bios.bak  C:\>debug bios.bin  a  mov ax,cs  add ax,10  mov es,ax  [ENTER key, blank line]  g 100  t  t  t  l  d es:fff0  e es:fff0  w  q    Here they are again with comments.  C:\>copy bios.bin bios.bak    [Takes a backup]  C:\>debug bios.bin    [Starts debug.exe, opening file bios.bin as a starting point]  a 100       [Starts to assemble (write) a small assembler program]  mov ax,cs    [Program line 1: Move the CodeSegment register to AX]  add ax,10    [Program line 2: Add 10 (hex) to the AX register]  mov es,ax    [Program line 3: Move the AX register to the ExtraSegment register]                  [Enter key, blank line to exit "a" mode.]  g 100        [Start running the program at address 100]  t            [Run line 1]  t            [Run line 2]  t            [Run line 3, at this point, ES now contains CS+10, see note below]  L            [This re-Loads bios.bin, undoing the temp program above]  d es:fff0    [This dumps the last 16 bytes of the bios, you should be able to see the date.]  e es:fff0    [This allows editing of the last 16 bytes.  Use SPACE to move to the next byte, enter numbers to change a byte,  ENTER to exit.]  [Repeat the last two commands as needed to get the date as you need it. Values are HEX ASCII]  w        [Writes the edited bios.bin to disk]  q        [Quit]    Note: The program is simply to set the ES register to CS+10, to make it possible to access the last 100 hex bytes of bios.bin.  Although debug.exe can load and save files larger than FF00 bytes in length, manual hex arithmetic or munging the segment  registers is required to display or edit anything beyond byte FF00.  You can do the arithmetic yourself and leave out the steps  between and including "a 100" and the last "t", if you use "r" to display the CS register value, "r es" to set the ES register  value, and enter the manually computed value CS+10(hex).    C:\>fc/b bios.bin bios.bak  [FileCompare /Binary] should show ONLY the edits to the date.  If there are other differences, then something went wrong with  the editing, try again.      3) Copy the file out of the guest file system into the host's filesystem.    4) Set the VM to use the bios file.    VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcbios/0/Config/BiosRom" "c:\bios.bin"    (Substitute your VM name for MyVM, and you will have to specify the path to VBoxManage.exe, this might work:      "%VBOX_INSTALL_PATH%VBoxManage.exe" setextradata ......)

Set the 'bios' time of the virtual box.

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: 
CODE: SELECT ALL   EXPAND VIEW
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};
}
 
 


 

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=Date%3A%3AManip&mode=all 

CODE: SELECT ALL   EXPAND VIEW
#!/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";
 
 

How to freeze date/time in VirtualBox?

I would like to ask how you can freeze the time and date in the virtual bios
so that it always starts at the sme time. I am running a Vista x64 host and
a x32 Ubuntuu 8.10.
I only found a thread which I can't access
http://www.virtualbox.org/search?q=freeze+date%2Ftime&noquickjump=1&ticket=on&discussion=on&changeset=on&wiki=on
(the first result). I found out that in VmWare this can be achived by
editing the *.vmx file and adding:

time.synchronize.continue = "FALSE"
time.synchronize.restore = "FALSE"
time.synchronize.resume.disk = "FALSE"
time.synchronize.shrink = "FALSE"
rtc.startTime = 1199206860
time.synchronize.tools.startup = FALSE


Does anyone know how to achieve similar results in Virtualbox?

Thank you for your time



You can't set an exact start time in VBox but you can set a BIOS time offset
from your current host system clock with
CODE: SELECT ALL EXPAND VIEW
VBoxManage modifyvm <name> -biossystemtimeoffset <msec>

There is nothing to stop you writing a simple script to compute this delta,
do the modifyvm and then start your machine. This should enable you to fix
the start time within a second or so, but not exactly the same.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.


https://forums.virtualbox.org/viewtopic.php?t=11234

2012年7月15日日曜日

XBMC Ported To Android

"Not a remote, not a thin client; the real deal. No root or jailbreak required. XBMC can be launched as an application on your set-top-box, tablet, phone, or wherever else Android may be found. The feature-set on Android is the same that you have come to expect from XBMC, no different from its cousin on the desktop. Running your favorite media-center software on small, cheap, embedded hardware is about to become a hassle-free reality. And as Android-based set-top-boxes are becoming more and more ubiquitous, it couldn't be a better time. ... We will begin releasing apks for interested beta testers in the coming weeks. But for those who are up to the task, as you would expect from XBMC, the source code is available. We have decided not to push to Google Play until we are satisfied that users with all kinds of devices get the same great XBMC experience."