After install Google Chrome in EC2 won't open from Ubuntu Server 14.04 LTS (HVM) command line [duplicate]
Connecting from Ubuntu and other Unix-like systems with X11-based GUIs
If I understand the situation correctly, you are connecting to a remote EC2 instance (perhaps a "cloud server"). You are probably using ssh
.
Installing an X server on the EC2 instance won't help, because you need this application's graphical interface to appear on your end, not on the screen attached to the server. (There probably is no such screen, but even if there were, it wouldn't help you.)
Assuming the machine you're connecting from (i.e., the computer you're physically using) is running Ubuntu or some other operating system that uses the X window system for its GUI, you can use X11 forwarding (ssh -X
).
Right now, you're probably connecting to the EC2 server with a command like:
ssh username@hostname
(Where hostname
is either the domain name or IP address of the EC2 instance, or perhaps its "simple name" if you're connecting through a VPN.)
To forward X11, change this to:
ssh -X username@hostname
In my experience, remotely controlled GUI applications run via ssh -X
often lag perceptibly. You may be able to improve performance by using the blowfish cipher:
ssh -c blowfish -X username@hostname
And unless your connection to the EC2 instance is extremely fast, you may be able to improve responsiveness further with data compression:
ssh -C -c blowfish -X username@hostname
(These can be used in any combination; for example, you could use ssh -C -X username@hostname
if you wanted.)
If ssh -X
doesn't work, it might be disabled on the server. In that case, open /etc/ssh/sshd_config
on the server. Search for a line that says X11Forwarding no
and change it to X11Forwarding yes
. (If there is no such line, simply add X11Forwarding yes
.)
Further reading: How to forward X over SSH from Ubuntu machine?
Connecting from Windows using PuTTY
If you are using PuTTY on Windows (which now appears to be the case, based on the screenshot you've uploaded), then this is still an SSH connection, but you're not using the ssh
command so the above client-side syntax won't help you.
Instead, you'll have to:
- Configure PuTTY to forward X11.
- Install an run an X11 server on your Windows system.
(Note that while your Windows system is the SSH client and the EC2 instance is the SSH server, it's the other way around for X11: the SSH client runs the X server and the SSH server runs the X client.)
X11 Forwarding using Xming and PuTTY explains how to install the Xming X server on your Windows system and configure PuTTY to forward X11. In short:
- Download Xming from its project page.
- Install Xming and Xming-fonts (both are included in what you downloaded).
- Run Xming.
- Run PuTTY, find X11 (it's in the left panel, under SSH, which itself is under Connection). Click on X11.
- Make sure the "Enable X11 forwarding" checkbox is checked, the contents of the textbox labeled "X display location" are
localhost:0
, and the option button under "Remote X11 authentication protocol" is set to MIT-Magic-Cookie-1. - Then connect with PuTTY to your EC2 instance, as normal.
Optionally (and not taken from that source):
- If you want to use the blowfish cipher, click SSH on the left panel, select Blowfish in the "Encryption cipher selection policy" listbox, and click the Up button until it's at the top of the list. That's essentially the equivalent of
-c blowfish
if you were using thessh
command. - If you want to use compression, then also after clicking SSH on the left panel, make sure the "Enable compression" checkbox, under "Protocol options," is checked.
See also:
- How to use X11 forwarding with putty
- Nathan Osman's answer to How to run GUI applications remotely on a headless server?