1

I have an Ubuntu server, it's 3TB HDD space total and 24GB RAM, I want to take 1 little bit of space and RAM to make VPS Windows using VirtualBox or KVM.

I want to install Windows Server 2008 on VirtualBox OR KVM, and I want to remote desktop from my home PC directly to the VPS I create with Vitualbox, and with network on.

But after searching internet for 2 days, I couldn't make it work, especially for the network part.

Here is my /etc/network/interfaces file :

Hetzner Online AG - installimage
 Loopback device:
auto lo
iface lo inet loopback
  device: eth0
 auto  eth0

iface eth0 inet static
    address   46.4.21.70
     broadcast 46.4.21.127
    netmask   255.255.255.192
    gateway   46.4.21.65
     # default route to access subnet
     up route add -net 46.4.21.64 netmask 255.255.255.192 gw 46.4.21.65 eth0
iface eth0 inet6 static
     address 2a01:4f8:131:410c::2
     netmask 64
      gateway fe80::1

The ifconfig command:

eth0      Link encap:Ethernet  HWaddr 6c:62:6d:7a:e8:62
          inet addr:46.4.21.70  Bcast:46.4.21.127  Mask:255.255.255.192
          inet6 addr: fe80::6e62:6dff:fe7a:e862/64 Scope:Link
          inet6 addr: 2a01:4f8:131:410c::2/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:302059 errors:0 dropped:0 overruns:0 frame:0
          TX packets:102335 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:392562631 (392.5 MB)  TX bytes:10964261 (10.9 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:42736 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42736 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3754256 (3.7 MB)  TX bytes:3754256 (3.7 MB)

The IP 46.4.21.70 is my Ubuntu server IP.

I tried set up network for the Virtualbox using NAT : could connect to the internet if using Virtualbox start from it, but I heard people say NAT can't be seen by outside world.

I tried selected Bridged Adapter : http://ultraimg.com/images/Capture87cc9.jpg : No internet access and here is the ipconfig I did on Windows server in Virtualbox http://ultraimg.com/images/Capture17e8de.jpg

  • To expose virtual server you need to NAT the ports which you are interest – Romeo Ninov May 7 '15 at 5:42
  • @RomeoNinov could you show me how to do it would be appreciated – Quan Nguyen May 7 '15 at 6:00
  • Have you read the manual of VirtualBox? – Romeo Ninov May 7 '15 at 6:02
  • 1
    @RomeoNinov hi there. I'm very noob on this thing, if I answer it stupid then forgive me :D. I'm still learning and trying to set up correctly. – Quan Nguyen May 7 '15 at 6:47
  • 1
    @RomeoNinov Hi. I want to say thank you !!! combine with the answer below, it works !!! Does this apply to KVM as well? – Quan Nguyen May 7 '15 at 7:00
1

I think this would work, though I do this for ssh into a Linux VM and not rdesktop. The principle is the same though. In VirtualBox, go into Settings -> Network for your VM and click Port Forwarding.

There you set up a rule with Protocol=TCP and Guest Port the default port for rdesktop. Sorry I don't know that number, the man page for rdesktop doesn't say. Host Port could be set to the same, unless it's some low number that the Ubuntu host already uses. Then when you connect to the Ubuntu host on that port it will be forwarded to the port in the VM. If you use another Host Port, you will need to add :port to your rdesktop command.

As one comment said you should also need to use NAT, in the Network settings you'll see Attatched to: and a drop down menu.

  • Hello there, thanks for your answer. I'm trying to set up now. Which IP address I should put in rdesktop? and do I need to set static IP for it? – Quan Nguyen May 7 '15 at 6:43
  • THanks so much. I put the server IP and it's working perfectly !! Thanks very much. It costed me 3-4 days of research but couldn't think this is very simple . – Quan Nguyen May 7 '15 at 7:06
0

With Bridged Adapter - Assign Ip address to your Windows Server, which is of range 46.4.21.66 - 46.4.21.126. As this was Ubuntu Server's IP range assigned to interface eth0. Advantage of bridged adapter will brings the device to your LAN network.

In case if you don't find free IP's of mentioned IP range. There is different method. Allocate two Network Interfaces to Windows VM

Adapter 1 (host-vm access)- "Host Only Adapter" (IP assigns automatically via DHCP)

Adapter 2 (for internet) - "NAT" (IP assigns automatically via DHCP)

Access the windows vm from Ubuntu(rdesktop) with IP address which got assigned to adapter 1 in windows vm

Follow steps here to enable Host only adapter in Ubuntu

  • THanks for your answer. Although both of the methods did not works for me. For the first one, I did try 46.4.21.81 / 46.4.21.69 /......21.100 . did not work. for the second one, Adapter 1 I chose Host Only Adapter but no name to choose. Check picture : i.imgur.com/nhH5kkR.jpg The only way I can make it work is using NAT and port forward it. Though I still want to try Bridged adapter, maybe I did not patient enough to test out all the IP? – Quan Nguyen May 7 '15 at 10:40
  • I haved added steps to enable host only adapter unix.stackexchange.com/a/201948/114311 – nageswar rao May 7 '15 at 11:26
  • Yeah, it shows up now, the virtualbox itself can connect to internet now, but the IP I assign in adapter 1, is for local, right? I mean, I can using the Ubuntu to connect it, but can not using that IP (192.168.56.1) connect from my PC home? – Quan Nguyen May 7 '15 at 17:47
  • ah ok, It works, I enter my Ubuntu IP server, and it works, but, the bad thing is , It didn't ask for login password :|. – Quan Nguyen May 7 '15 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.