Posted by : gon in (Software Libre)
VirtualBox! You save my day
Tagged Under : .net, sql server, virtualbox, virtualización
My first deployment attempt with my fingerprint reader application was not very good.
First, I was informed late about the version that ran the server: SQL Server 7. Moreover, it is difficult to go any time to make room for any evidence, even worse to sit quiet coding. The first thing we tried long ago, was to make a backup of the entire database. Assuming Microsoft Management Studio would be enough to connect to the database and create new tables, has been the first thing I thought to do that day.
But as Murphy’s law is always, I found an uncomfortable message, saying Unable to connect to an earlier version of SQL Server lower to 2000 (ie, version 8). Because Management Studio is based on. NET, I doubted that my .NET application could connect. Later, I discovered that I was wrong, but at the time I had no alternative other than to evaluate more solutions.
So, during this phase of the evaluation of new solutions, we feel completely replicate the server to find out how to run everything. To do this, we get a copy of SQL Server 7. Unfortunately, I was unable to install over XP. Therefore, in addition we get a copy of Windows 2000 Server.
Saving my digital dark age
The first thing I thought, was to install Windows 2000 server on the machine we had for testing. But even if successful, would not work when I take the notebook out of the lab. ” also could not install the system at the notebook, because my partition is already in use for 2 operating systems.
Connecting to my digital dark age
The second test was to determine whether the application. NET was able to connect to SQL Server 7. Again thanks to @janitux who taught me this trick, I was able to make a connection from my Host Operating System (Windows XP and/or Kubuntu) to my Guest Operating System (Windows 2000 server) which runs SQL Server 7. To got it, you must create a port forwarding (same concept applies to a router). When I connect to a X port on my host machine, the request will go to the guest machine. Configuration is done in a console like this:
cd C:\"Archivos de Programa"\"Sun\"xVM VirtualBox"\ VBoxManage.exe setextradata "vmName" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/PORT_FORDWARD_NAME/HostPort" HOST_PORT VBoxManage.exe setextradata "vmName" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/PORT_FORDWARD_NAME/GuestPort" VM_PORT VBoxManage.exe setextradata "vmName" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/PORT_FORDWARD_NAME/Protocol" TCP :: :::: done!
- vmName = My vitual Machine name
- PORT_FORDWARD_NAME = a name for redirect fordward (ie: http, ftp, myHttp, sql, …)
- HOST_PORT = port number to connect from host machine
- VM_PORT = port number to send request in guest machine
(When I have time, try the same on Linux)
After that, I connect to localhost: 1433 (default port for SQL Server) and go! It runs perfect
.
Success!
Despite working with a proprietary platform, the solutions to various problems, went through the application of free software. No doubt a great success. : D

bueno, ahora vi que los comandos para la redireccion son iguales en linux y windows (excepto por el .exe :P) y tb da lo mismo lo que pongas en SQL, solo es para diferenciar las reglas.
bye