Access a Linux VM via xRDP
You can connect to a CloudShare Linux-based VM by installing xRDP, which enables non-Windows operating systems to provide users with a standard Microsoft Remote Desktop Protocol (RDP) compatible experience.
The popular open-source xRDP application supports common RDP features like built-in TLS encryption, two-way clipboard transfers, audio redirection and the ability to mount a local drive on remote machines.
To use xRDP with a Linux VM:
-
Prepare the target VM.
-
Optionally prepare a custom keyboard map file.
-
Connect to the target VM.
In order to make xRDP access possible, a Desktop environment must be installed on the target Linux VM.
Preparing for xRDP Access
-
Create an environment that includes your target Linux-based VM and save it. The Details page for the new environment will be displayed.
-
From the Details page, click View VM to access the VM in your browser. The environment will be displayed with your target VM active.
-
Login to the terminal of the target VM and install xRDP.
Note
You can use any standard xRDP installation process that suits your needs, for example: http://c-nergy.be/blog/?p=8952 or https://community.spiceworks.com/how_to/155718-install-xrdp-on-ubuntu-18-04.
-
On the target VM, perform the following steps to configure the GUI:
-
In the folder
/home/loggeduser
, open the~/.xsession
file and add the linegnome-session
. This will replace the initial xRDP GUI setting with Gnome UI, so that the xRDP GUI will be identical to the GUI used by the Console (CON). -
Restart the xRDP service: From a command line, enter
systemctl restart xrdp.service
. -
Log out of the Console desktop session.
-
-
After xRDP installation and configuration on the target VM, on the right side of the Details page, click Edit Environment and then Customize Viewer. The Customize Environment Viewer page is displayed:
-
From the Apply settings from dropdown list, select Custom Settings. This makes all basic settings editable.
-
Click Switch to Advanced Mode. The Advanced Settings options are displayed.
-
Click your target Linux-based VM. The customization options for that VM will be displayed.
-
Toggle the Allow RDP option to ON.
-
At the upper right corner of the page, click Save. The new custom VM settings will be saved.
-
-
If your desired keyboard layout is different from the default setting, from the Keyboard dropdown menu, select the desired keyboard layout.
If your keyboard's layout is not included in the xRDP installation, you can create and assign a custom keyboard layout map to the target VM, as detailed below.
Creating a Custom Keyboard Map File (Optional)
Since xRDP is installed with only a minimum set of keyboard layout maps, if your target VM will require a keyboard language layout that is not included with this set, you'll need to create the custom keyboard map file and copy it to the target VM.
You cannot generate the keyboard map file from inside an xRDP session. You'll need to connect to an X-Org display with a physical keyboard. You do not have to do this from the target VM; you can generate a custom map from any Linux machine with X-Org and xRDP installed.
Tip
Alternatively, you can spin up a desktop Ubuntu VM in Hyper-V or Virtual-Box and install xRDP on that, ensuring that you have the keyboard with the desired layout connected.
-
In a terminal, set a dual keyboard layout by entering the command:
Note
For a list of available layout codes (e.g., ‘us’ or ‘ru’), enter the command: man xkeyboard-config
This assigns your choice to the current keyboard layout.
You can switch between keyboard layouts by using the key combination <Win>-<Space>.
-
Make sure the desired keyboard layout is active and then enter the generate keymap command:
$ xrdp-genkeymap <your-map-filename>
-
Determine the correct language layout code for your custom keyboard. You can find all standard layout codes at: http://xrdp.sourceforge.net/documents/keymap/rfc1766.html.
-
Copy your generated keymap file to the target VM and assign it with the correct layout code by entering the command:
$ cp <your-map-filename> /etc/xrdp/km-<layout code>.ini
Note
Unicode is not supported as a custom keyboard layout.
Connecting to the Linux VM
After you have performed all xRDP preparations described above on your target VM, you can access the VM directly from the CloudShare Viewer.
You can also access the VM via a remote Windows platform using a standard RDP client:
-
From the associated Environment Details page, select your target VM and click More details. The target VM access properties will be displayed.
-
Enter the External Address, Username and Password values of your target VM into the RDP client to establish a connection.
For complete RDP connection instructions, see Connect to a VM via RDP Client.
Comments
0 comments
Article is closed for comments.