Hi all
I've VritualBox running a Win 2003 Server on my 64bit Ubuntu 9.10 desktop installation. And that in turn is running Microsoft SQL Server.
I can access SQL server from my ubuntu desktop as http://win2003server:1433.
But I want to be able to access it is http://localhost:1433, as if it was actually running on ubuntu.
So what I want to know is, is there a way to forward all localhost:1433 traffic automatically to win2003server:1433? Is there a better solution?
You might be able to do it with iptables? (Guessing!)
Paul Grenyer wrote:
Hi all
I've VritualBox running a Win 2003 Server on my 64bit Ubuntu 9.10 desktop installation. And that in turn is running Microsoft SQL Server.
I can access SQL server from my ubuntu desktop as http://win2003server:1433.
But I want to be able to access it is http://localhost:1433, as if it was actually running on ubuntu.
So what I want to know is, is there a way to forward all localhost:1433 traffic automatically to win2003server:1433? Is there a better solution?
I don't know if this is the best solution, but I think it would work.
Port forwarding using SSH.
E.g. http://www.ssh.com/support/documentation/online/ssh/adminguide/32/Port_Forwa... or google port forwarding with SSH
A SSH Client for windows is PUTTY http://www.chiark.greenend.org.uk/~sgtatham/putty/ For linux it's ssh or sshd (I think) provided by the Openssh-client and openssh-server packages.
You'd need to run ssh on both the Linux side and the Windows side. The snag in this I think is that PUTTY is a ssh client and I think what you need on the Windows side is a server. However, ISTR that it's possible to run SSH backwards, and have the server program acting as a "receiver", and the client as a "sender".
Alternatively to Putty, you could perhaps install and run Cygwin on the Windows end, this may allow you to run the ssh server on windows, and a ssh client on the Linux end.
I don't know if you can achieve any of this with IPTables.
Hope that helps in some way! By the way, why don't you want to access the server as http://win2003server:1433?
Regards Steve
On 05 Jan 20:09, Paul Grenyer wrote:
Hi all
I've VritualBox running a Win 2003 Server on my 64bit Ubuntu 9.10 desktop installation. And that in turn is running Microsoft SQL Server.
I can access SQL server from my ubuntu desktop as http://win2003server:1433.
But I want to be able to access it is http://localhost:1433, as if it was actually running on ubuntu.
So what I want to know is, is there a way to forward all localhost:1433 traffic automatically to win2003server:1433? Is there a better solution?
iptables -t nat -A PREROUTING -p tcp -d localhost -dport 1433 \ -j DNAT --to win2003server:1433 iptables -t nat -A FORWARD -p tcp -d win2003server -dport 1433 \ -j ACCEPT
Those should do it. Though that's untested ;)
Cheers,
I'm pretty sure you can just use the VBoxManage command - it's documented in the VirtualBox manual.
A blog description is available here:
http://sk.c-wd.net/wp/2008/01/05/virtualbox-port-forwarding-with-linux-host/
HTH,
Peter.
2010/1/5 Brett Parker iDunno@sommitrealweird.co.uk:
On 05 Jan 20:09, Paul Grenyer wrote:
Hi all
I've VritualBox running a Win 2003 Server on my 64bit Ubuntu 9.10 desktop installation. And that in turn is running Microsoft SQL Server.
I can access SQL server from my ubuntu desktop as http://win2003server:1433.
But I want to be able to access it is http://localhost:1433, as if it was actually running on ubuntu.
So what I want to know is, is there a way to forward all localhost:1433 traffic automatically to win2003server:1433? Is there a better solution?
iptables -t nat -A PREROUTING -p tcp -d localhost -dport 1433 \ -j DNAT --to win2003server:1433 iptables -t nat -A FORWARD -p tcp -d win2003server -dport 1433 \ -j ACCEPT
Those should do it. Though that's untested ;)
Cheers,
Brett Parker
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
Hi All
On Tue, Jan 5, 2010 at 11:03 PM, samwise samwise@bagshot-row.org wrote:
I'm pretty sure you can just use the VBoxManage command - it's documented in the VirtualBox manual.
A blog description is available here:
http://sk.c-wd.net/wp/2008/01/05/virtualbox-port-forwarding-with-linux-host/
I tried as Peter suggested:
VBoxManage setextradata WinSrv2003 VBoxInternal/Devices/pcnet/0/LUN#0/Config/mssql/HostPort 1433
VBoxManage setextradata WinSrv2003 VBoxInternal/Devices/pcnet/0/LUN#0/Config/mssql/GuestPort 1433
VBoxManage setextradata WinSrv2003 VBoxInternal/Devices/pcnet/0/LUN#0/Config/mssql/Protocol TCP
I restarted VirtualBox as the instructions suggested and now when I try and start my VM I get what you can see in the attached picture.
I'll have some time to see if I can undo the commands later, but if anyone has seen this before and has some suggestions it would be greatly appreciated.
Paul,
I notice you didn't include the quotation marks in the commands you quoted. That may well make a difference.
The relevant part of the manual is here:
http://www.virtualbox.org/manual/UserManual.html#natforward
If that doesn't fix it, try releasing the .vdi disk image, delete your virtual machine and then create a new virtual machine using your old .vdi disk image.
Peter.
2010/1/7 Paul Grenyer paul.grenyer@gmail.com:
Hi All
On Tue, Jan 5, 2010 at 11:03 PM, samwise samwise@bagshot-row.org wrote:
I'm pretty sure you can just use the VBoxManage command - it's documented in the VirtualBox manual.
A blog description is available here:
http://sk.c-wd.net/wp/2008/01/05/virtualbox-port-forwarding-with-linux-host/
I tried as Peter suggested:
VBoxManage setextradata WinSrv2003 VBoxInternal/Devices/pcnet/0/LUN#0/Config/mssql/HostPort 1433
VBoxManage setextradata WinSrv2003 VBoxInternal/Devices/pcnet/0/LUN#0/Config/mssql/GuestPort 1433
VBoxManage setextradata WinSrv2003 VBoxInternal/Devices/pcnet/0/LUN#0/Config/mssql/Protocol TCP
I restarted VirtualBox as the instructions suggested and now when I try and start my VM I get what you can see in the attached picture.
I'll have some time to see if I can undo the commands later, but if anyone has seen this before and has some suggestions it would be greatly appreciated.
-- Thanks Paul
Paul Grenyer e: paul.grenyer@gmail.com b: paulgrenyer.blogspot.com
Hi Peter
If that doesn't fix it, try releasing the .vdi disk image, delete your virtual machine and then create a new virtual machine using your old .vdi disk image.
That worked!
I notice you didn't include the quotation marks in the commands you quoted. That may well make a difference.
The relevant part of the manual is here:
and so did adding the quotes!
I can now connect to my Ubuntu desktop machine as if it was actually running Microsoft SQL server!
Now I just need to see if I can run VirtualBox as a server (I'll check the manual) and Management Studio under something like WINE.
Thanks Peter!
Paul,
I'm not exactly 100% sure what you mean by running VirtualBox as a server, but I'd suggest doing:
VBoxManage --help
in a console window. And perhaps the sort of command you are looking for to run a VirtualBox guest as a server is
VBoxManage startvm <VMNAME> --type headless
This command will not start any GUI windows for you and pretty much means that the only hope of getting to the desktop of your virtual windows machine is using remote desktop (try rdesktop on linux). But given a few minutes to boot up and get started you should soon be able to access your SQL server without needing any X GUI windows running. And the step after that is a simple init script to run this command at boot time of the machine.
I might be able to help a bit more with this if you have any questions because I am working on this at work at the moment :)
Cheers, Pete
2010/1/7 Paul Grenyer paul.grenyer@gmail.com:
Hi Peter
If that doesn't fix it, try releasing the .vdi disk image, delete your virtual machine and then create a new virtual machine using your old .vdi disk image.
That worked!
I notice you didn't include the quotation marks in the commands you quoted. That may well make a difference.
The relevant part of the manual is here:
and so did adding the quotes!
I can now connect to my Ubuntu desktop machine as if it was actually running Microsoft SQL server!
Now I just need to see if I can run VirtualBox as a server (I'll check the manual) and Management Studio under something like WINE.
Thanks Peter!
-- Thanks Paul
Paul Grenyer e: paul.grenyer@gmail.com b: paulgrenyer.blogspot.com
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
Hi
On Fri, Jan 8, 2010 at 9:15 AM, Peter Thorpe peter.3.thorpe@googlemail.com wrote:
Paul,
I'm not exactly 100% sure what you mean by running VirtualBox as a server, but I'd suggest doing:
VBoxManage --help
in a console window. And perhaps the sort of command you are looking for to run a VirtualBox guest as a server is
VBoxManage startvm <VMNAME> --type headless
Yes, that's exactly what I was looking for, thanks.
This command will not start any GUI windows for you and pretty much means that the only hope of getting to the desktop of your virtual windows machine is using remote desktop (try rdesktop on linux).
Yeah, I've used rdesktop quite a bit. However, I don't seem to be able to connect when I run in headless mode, can't even ping, even though I can see the VM registered on my router.
But given a few minutes to boot up and get started you should soon be able to access your SQL server without needing any X GUI windows running. And the step after that is a simple init script to run this command at boot time of the machine.
I might be able to help a bit more with this if you have any questions because I am working on this at work at the moment :)
Cool! In that case, is there a way to write a script to shut down the Windows 2003 Server VM cleanly?
Paul Grenyer wrote:
Cool! In that case, is there a way to write a script to shut down the Windows 2003 Server VM cleanly?
There are various samba rpc commands you can fire at a Windows box to tell it to shutdown. However whether it will obey them depends on the local security policy and OS version.
Normally it would be something like rpcclient -c 'shutdown' -U username -I ipaddress however Server 2003 generally requires a reason code and I am not sure how you supply that.
Look at man rpcclient for clues.
2010/1/8 Paul Grenyer paul.grenyer@gmail.com:
Hi
On Fri, Jan 8, 2010 at 9:15 AM, Peter Thorpe peter.3.thorpe@googlemail.com wrote:
Paul,
I'm not exactly 100% sure what you mean by running VirtualBox as a server, but I'd suggest doing:
VBoxManage --help
in a console window. And perhaps the sort of command you are looking for to run a VirtualBox guest as a server is
VBoxManage startvm <VMNAME> --type headless
Yes, that's exactly what I was looking for, thanks.
This command will not start any GUI windows for you and pretty much means that the only hope of getting to the desktop of your virtual windows machine is using remote desktop (try rdesktop on linux).
Yeah, I've used rdesktop quite a bit. However, I don't seem to be able to connect when I run in headless mode, can't even ping, even though I can see the VM registered on my router.
Hmmm...that's odd. Does the VM use DHCP to get it's address?
During my playing at work I have run into a few networky type issues with running a VM this way. I'm wondering whether VirtualBox is changing the MAC address of the machine for some reason.
But given a few minutes to boot up and get started you should soon be able to access your SQL server without needing any X GUI windows running. And the step after that is a simple init script to run this command at boot time of the machine.
I might be able to help a bit more with this if you have any questions because I am working on this at work at the moment :)
Cool! In that case, is there a way to write a script to shut down the Windows 2003 Server VM cleanly?
I believe that from the VirtualBox GUI you have the option to send an ACPI Switch Off signal to the VM. I'm guessing (don't have any of the stuff in front of me at home) that the command line should offer the same option. Although whether it actually convinces the VM to do anything useful I'm not sure. I'm sure I tried it a couple of times and it did precious little.
The VM I'm using at work is actually a CentOS VM so to shut mine down cleanly I can do a (passwordless) ssh into the machine and issue "shutdown -h now".
I'll have a closer look tomorrow when I'm in front of the scripts again.
-- Thanks Paul
Paul Grenyer e: paul.grenyer@gmail.com b: paulgrenyer.blogspot.com