Desktop Sharing Ubuntu Windows

Nov 15, 2017  Ubuntu and other desktop computers should be able to view and connect to the shares however, if the shares are not advertised, you will need to connect to the shares manually by typing the resource network address. To get started with access Windows shares across the network, follow the guide below: Access Windows Shares. The default Wayland gnome desktop will not work with Desktop Sharing for security reasons. So, we need to either use a different solution or we can switch to Ubuntu Xorg desktop. Which is still gnome and not Unity. Select Gear icon next to login. Select second option Ubuntu xorg.

The real reason why Canonical and Microsoft brought Ubuntu to Windows 10 was to enable system administrators and developers to use Bash and other Linux shell programs, such as make, gawk and grep, on Windows. Linux users, being natural hackers, immediately started working on bringing Linux graphical desktops to Windows Subsystem for Linux (WSL).

Guess what? They've done it.

A Guatemalan programmer who goes by the GitHub handle Guerra24, has 'managed to run Unity [Ubuntu's default desktop interface] inside WSL, this shows that is fully capable of running an entire Desktop Environment.'

This isn't easy to do, and it's a long way from being a complete Linux desktop, but it's a start. If you want to run the Ubuntu Linux desktop in Windows 10 for work, I recommend you do it via a virtual machine (VM) program such as Oracle's VirtualBox. But, if you just want to have fun and sharpen your desktop programming skills, you too can try running Ubuntu on Windows 10 natively.

To get started on this project today, you need to be running the beta Windows 10 Fast Ring release. With the public release of the Windows 10 Anniversary Update, everyone will be able to give it a try.

So how do you do it? After updating Windows 10, follow along with me.

First you must turn on Windows 10's Developer Mode via Settings > Update & security > For developers. Next, search for 'Windows Features' and choose 'Turn Windows features on or off' and enable Windows Subsystem for Linux (Beta).

After that, to install Bash, you must open the Windows Command Prompt and type 'bash.' You'll be asked to accept the terms of service and download Ubuntu. The typical Ubuntu download is a bit less than one gigabyte. So, if you have a slow internet connection, be ready to wait. Once installed, you'll be running a userspace version of Ubuntu 14.04 on top of WSL.

Technically, you're not running Linux. It may look like Linux and squeak like Tux, the Linux penguin; but it's not Linux. That's because the Ubuntu userspace is running not on a Linux kernel, but WSL. WSL provides the API hooks to look like Linux to Ubuntu and Linux applications, but it's not the same thing. This will become important as we go along.

Once you have Ubuntu installed, you'll need to update it. You do that from the Bash shell by running the following commands:

1. apt-get update

Sharing

2. apt-get upgrade

Now, switch back to Windows 10 and install a Windows compatible Xserver. This is what Ubuntu uses to display a graphical interface. The best of these for our purposes are vcxsrv or Xming.

Next, you have to tell Ubuntu about the Xserver so it can use it. To do this you can enter the following command at the shell:

DISPLAY=:0.0

Now, any graphical Linux program will display on Windows 10. Better still, if you're going to keep working with graphical Linux software on WSL, have WSL automatically ready itself for graphical programs by placing the command in Bash's configuration file: '.bashrc'. An easy way to do this is to use the echo command to write it with the following shell command.

echo 'export DISPLAY=:0.0' >> ~/.bashrc

After this, you can run graphical Linux programs, such as Firefox, or desktops... but they won't run well or for long. That's because WSL doesn't include socket support. Sockets are what Unix and Linux use to communicate between services. On the Linux desktop, the default way to implement sockets is the D-Bus messaging system. Without D-Bus, many Linux desktop graphical programs don't work that well, if, at all.

WSL does, however, support the TCP networking protocol and a Reddit user named ShaRose has found a way to make D-Bus use tcp in place of sockets. Perfect? No. But it works.

To enable this, run the following command:

sudo sed -i 's/<listen>.*</listen>/<listen>tcp:host=localhost,port=0</listen>/' /etc/dbus-1/session.conf

This used the sed stream editor to change D-Bus's configuration file so that from here on out it will use tcp instead of sockets. The end result? Applications that need D-Bus will now run on WSL.

In the next step, it's time to install the graphical desktop programs. You do this by running these programs from Bash:

  • apt-get install ubuntu-desktop
  • apt-get install unity
  • apt-get install compiz-core
  • apt-get install compizconfig-settings-manager

The first command installs the basic Ubuntu desktop programs. This will include end-user programs such as LibreOffice, The next instruction installs the Unity desktop. The final two commands install, Compiz, an OpenGL graphics composting manager and its front-end ccsm. Your next step will be to use ccsm to set up the desktop's settings.

After all these programs are installed, run ccsm from Bash. From the ccsm interface, you'll need to enable the following Compiz plugins:

General:

  • Commands
  • Composite
  • Copy to texture
  • OpenGL

Desktop:

Ubuntu Screen Sharing Port

  • Ubuntu Unity Plugin

Image Loading:

  • PNG

Utility:

  • Compiz Library Toolbox
  • Windows Management
  • Move Window
  • Place Windows
  • Resize Window
  • Scale
  • Snapping Windows

Now, to get this show on the road, close ccsm and bring up the Unity interface by running compiz from Bash.

In a minute or so you should have Unity up and running.

Now, don't go into this with false expectations. It's not going to run well. But, on my Windows 10 test system, an ASUS desktop with an third-generation i7 3770 processor, and 8GBs of RAM, it ran well enough that I'm sure someone will eventually find a way to get the Ubuntu desktop to run usefully on WSL.

Now, if you'll excuse me I'm off to see if I can get Quake, the old first-person shooter game, running on WSL. I'm 'this' close to getting it to run.

Related Stories:

Related Topics:

Linux Cloud Big Data Analytics Innovation Tech and Work Collaboration

There are many reasons why you might want to connect to a computer remotely.

Maybe you are at work and you have realized you have left that important document on your computer at home and need to get it without getting back in the car and embarking on a 20-mile journey.

Possibly you have a friend who is having issues with their computer running Ubuntu and you wish to offer your services to help them fix it but without having to leave the house.

Whatever your reasons are for needing to connect to your computer this guide will help to achieve that aim, as long as the computer is running Ubuntu.

How to Share Your Ubuntu Desktop

There are two ways to set up a remote desktop using Ubuntu. The one we are going to show you is the more official way and the method that the Ubuntu developers have decided to include as part of the main system.

The second way is to use a piece of software called xRDP. Unfortunately, this software is a bit hit and miss when running on Ubuntu and while you may now be able to access the desktop you will find the experience a little frustrating due to mouse and cursor issues and general graphics based problems.

It is all due to the GNOME/Unity desktop that is installed by default with Ubuntu. You could go down the route of installing another desktop environment, but you may deem this as overkill.

The actual process of sharing the desktop is relatively straightforward. The tricky bit is trying to access it from somewhere that isn't on your home networks such as your workplace, hotel or internet cafe.

This guide will show you how to connect to the computer using Windows, Ubuntu and even your mobile phone.

To Start the Process

  1. Click on the icon at the top of the Unity Launcher which is the bar down the left side of the screen.
  2. When the Unity Dash appears to start entering the word 'Desktop.'
  3. An icon will appear with the words Desktop Sharing underneath. Click on this icon.

Setting Up Desktop Sharing

The desktop sharing interface is broken down into three sections:

  1. Sharing
  2. Security
  3. Show notification area icon

Sharing

The sharing section has two available options:

  1. Allow other users to view your desktop.
  2. Allow other users to control your desktop.

If you wish to show another person something on your computer but you don't want them to be able to make changes then just tick the Allow other users to view your desktop option.

If you know the person who is going to be connecting to your computer or indeed it is going to be you from another location tick both boxes.

Do not allow somebody you do not know to have control over your desktop as they can damage your system and delete your files.

Security

  1. You must confirm each access to this machine.
  2. Require the user to enter this password.
  3. Automatically configure UPnP router to open and forward ports.

If you are setting up the desktop sharing so that other people can connect to your computer to show them your screen then you should check the box for You must confirm each access to this machine. This means you know exactly how many people are connecting to your computer.

If you intend to connect to the computer from another destination yourself then you should make sure the You must confirm each access to this machine does not have a check mark in it. If you are elsewhere then you won't be around to confirm the connection.

Whatever your reason for setting up desktop sharing you should definitely set a password. Place a check mark in the Require the user to use this password box and then enter the best password you can think of into the space provided.

The third option deals with accessing the computer from outside your network. By default, your home router will be set up to only allow other computers connected to that router to know about the other computers and devices connected to that network. To connect from the outside world your router needs to open a port to allow that computer to join the network and have access to the computer you're are trying to connect to.

Some routers allow you to configure this within Ubuntu and if you intend to connect from outside your network it is worth placing a tick into the Automatically configure UPnP router to open and forward ports.

Show Notifications Area Icon

The notification area is in the top right corner of your Ubuntu desktop. You can configure the desktop sharing to show an icon to show it is running.

The options available are as follows:

  1. Always
  2. Only when someone is connected
  3. Never

If you choose the Always option then an icon will appear until you turn desktop sharing off. If you choose Only when someone is connected the icon will only appear if someone connects to the computer. The final option is to never show the icon.

When you have chosen the settings that are right for you click on the Close button. You are now ready to connect from another computer.

Take a Note Of Your IP Address

Before you can connect to your Ubuntu desktop using another computer you need to find out the IP address that has been assigned to it.

The IP address you require depends on whether you are connecting from the same network or whether you are connecting from a different network. Generally speaking if you are in the same house as the computer you are connecting to then you are more than likely going to need the internal IP address, otherwise you will need the external IP address.

How To Find Your Internal IP Address

  1. From the computer running Ubuntu open a terminal window by pressing the ALT + T keys at the same time.
  2. Type the following command into the window:
  3. A list of potential access points will be displayed in short blocks of text with a line space between each one.
  4. If your machine is connected directly to the router using a cable then look for the block starting ETH:. If, however, you are using a wireless connection look for the section starting something like WLAN0 or WLP2S0. The option will vary for the wireless access point depending on the network card used.
  5. There are generally 3 blocks of text. ETH is for wired connections, Lo stands for local network and you can ignore this one and the third one will be the one you are looking for when connecting via Wi-Fi.
  6. Within the block of text look for the word INET and note the numbers down on a piece of paper. They will be something along the lines of 192.168.1.100. This is your internal IP address.

How To Find Your External IP Address

The external IP address is more easily found.

From the computer running Ubuntu open a web browser such as Firefox (usually the third icon from top on the Unity Launcher) and go to Google.

Now type What is my IP. Google will return the result of your external IP address. Write this down.

Connecting to Your Ubuntu Desktop From Windows

Whether you intend to connect to Ubuntu from your own home or elsewhere it is worth trying it out at home first to make sure it is running correctly.

Your computer running Ubuntu must be switched on and you must be logged in (although the lock screen can be showing).

Remote connect to ubuntu from windows

In order to connect from Windows you need a piece of software called a VNC Client. There are loads to choose from but the one we recommend is called RealVNC.

To download RealVNC go to https://www.realvnc.com/en/connect/download/viewer/

  1. Click on the big blue button with the words Download VNC Viewer.
  2. After the download has finished click on the executable (called something like VNC-Viewer-6.0.2-Windows-64bit.exe). This file will be located in your downloads folder.
  3. The first screen you will see is a license agreement Check the box to show you accept the terms and conditions and then click OK.
  4. The next screen shows you all the functionality of Real VNC Viewer.
    Note: There is a check box at the bottom of this screen that says usage data will be sent anonymously to the developers. This sort of data is usually used for bug fixing and improvements but you may wish to uncheck this option.
  5. Click the Got It button to move on to the main interface.
  6. To connect to your Ubuntu desktop type the internal IP address into the box which contains the text Enter a VNC server address or search.
  7. A password box should now appear and you can enter the password created when you set up desktop sharing.

Ubuntu should now appear.

Troubleshooting

You may receive an error stating that the connection cannot be made because the encryption level is too high on the Ubuntu computer.

The first thing to try is to increase the level of encryption the VNC Viewer is attempting to use. To do this:

  1. Choose File > New Connection.
  2. Enter the internal IP address into the box VNC Server.
  3. Give the connection a name.
  4. Change the Encryption option to be always maximum.
  5. Click OK.
  6. A new icon will appear in the window with the name you gave it in step 2.
  7. Double-click on the icon.

If this fails right-click on the icon and click Properties and try each encryption option in turn.

In the event that none of the options work follow these instructions

  1. Open a terminal on the Ubuntu computer (press ALT + T)
  2. Type the following command:

You should now be able to try to connect to Ubuntu again using Windows.

Connect to Ubuntu From The Outside World

To connect to Ubuntu from the outside world you need to use the external IP address. When you try this the first time you will probably not be able to connect. The reason for this is that you need to open a port on your router to allow outside connections.

The way to open ports is a diverse subject as each router has its own way of doing this. There is a guide on Lifewire to do with port forwarding but for a more extensive guide visit https://portforward.com/.

Start by visiting https://portforward.com/router.htm and choose the make and model for your router. There are step by step instructions for hundreds of different routers so yours should be catered for.

Connect to Ubuntu Using Your Mobile Phone

Connecting to the Ubuntu desktop from your Android phone or tablet is as easy as it is for Windows.

Open up the Google Play Store and search for VNC Viewer. The VNC Viewer is provided by the same developers as the Windows application.

  1. Open up the VNC Viewer and skip past all the instructions.
  2. Eventually, you will get to a blank screen with a green circle with a white plus symbol in the bottom right corner. Click on this icon.
  3. Enter the IP address for your Ubuntu computer (either internal or external depending where you are located). Give your computer a name.
  4. Click the Create button and you will now see a screen with a Connect button. Click Connect.
  5. A warning may appear about connecting over an unencrypted connection. Ignore the warning and enter your password as you did when connecting from Windows.

Ubuntu Windows Installer

Your Ubuntu desktop should now appear on your phone or tablet.

The performance of the application will depend on the resources of the device you are using.