Remotely connect an Ubuntu virtual machine via the XRDP protocol

Source: Internet
Author: User

Here's how to set up an Ubuntu virtual machine to allow other machines to connect remotely. The steps here are for ubuntu12.04.


Step 1: Install the XRDP protocol

sudo apt-get install xrdp vnc4server xbase-clients


Step 2: Set up remote sharing

Open the desktop Sharing in the/usr/share/applications directory and set the following:

650) this.width=650; "src=" Http://img.it610.com/image/info2/dbe5906dcd974fc38aae828edec7862a.jpg "alt=" Remote connection to Ubuntu 14.04 desktop environment via VNC under Windows-2nd picture "/>


* For ubuntu14.04 and above, secure access settings are required:

1. Install Dconf-editor:

sudo apt-get install Dconf-editor

2. Counter-select prompt-enabled and require-encryption:

650) this.width=650; "src=" Http://img.it610.com/image/info2/7f155bf45f6042fd9a0f12f0e38e31b0.jpg "alt=" Remote connection to Ubuntu 14.04 desktop environment via VNC under Windows-4th picture "/>


Step 3: Set iptables port mappings

Since XRDP is connected using port 3389, the extranet is not able to connect directly to the Ubuntu virtual machine, so you need to set up the iptables port mapping in the host.

1. View the network information in the virtual machine:

Terminal Invoke command: Nm-tool

You can see the IP address and the gateway address.

2. Set Iptables port mapping rules

IPTABLES-T nat-i prerouting-d Host IP address-p TCP--dport 33899-j DNAT--to-destination virtual machine IP address: 3389

IPTABLES-T nat-i postrouting-d Virtual machine IP address-p TCP--dport-j SNAT--to gateway address


* 33899 in the first rule above is not fixed, you can use any unused port


Step 4: Connect an Ubuntu virtual machine using the Remote connection tool

The address at the time of connection is: Host IP address: 33899

* Note 33899 This port needs to be consistent with the ports used in the previous setup Iptables port mapping rules



With the 4 steps above, we can remotely connect to a virtual machine from the outside network

Remotely connect an Ubuntu virtual machine via the XRDP protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.