Q:

How to use VirtualBox as a SQLServer Host?

I installed Windows server 2008 and SQL Server 2008 on VirtualBox, now I want to remotely connect to it via php.
I don't know what kind of network connection is needed, how to set it and...

A:

First you need to set your guest OS networking as Bridge. In my case I use eth1, but proably your is eth0.
 
Now when you start windows, check that the ip is of the same local network of your host machine (launch cmd and next digit ipconfig).
If the ip is right, try to ping your guest machine from Ubuntu host machine:
ping ip_guest

If all is ok, now you can access your guest machine (windows) from your host machine (Ubuntu).
I've recently migrated an application from mssql 2005 to MySql (precisely MariaDB) and I have developed a set of scripts in php to do this task.
For remotly connect to a sql server I'have installed through Synaptic the php5-sybase extension. 
Next from my php scripts I have opened two connection, one with sql server and one with MySql and migrated the desired data.
/*mssql*/
$server_from="ip_guest\SQLEXPRESS";
$username_from="mssql_user"; //mine is sa
$password_from="mssql_password";

/*MySql*/
$server_to   = "127.0.0.1";
$username_to = "mysql_user";
$password_to = "mysql_password";

//FROM Connect to MSSQL
$link_from = mssql_connect($server_from, $username_from, $password_from);
//TO Connect to MySQL
$link_to = mysql_connect($server_to, $username_to, $password_to);

Mssql function are analogue to the Mysql one: http://it.php.net/manual/en/book.mssql.php
It change only the prefix...

