Amazon EC2 Linux实例中的GUI

时间:2023-01-26 12:55:46

I would like to use Amazon EC2 but I need to know if an AMI with Linux distribution with GUI exists.

我想使用Amazon EC2,但我需要知道是否存在带有GUI的Linux发行版的AMI。

5 个解决方案

#1


16  

This works on RHEL 6.3 64-bit: (note: # means superuser and can be replaced by sudo)

这适用于RHEL 6.3 64位:(注意:#表示超级用户,可以用sudo替换)

# yum groupinstall "Desktop"    
# yum install tigervnc-server xorg-x11-fonts-Type1
# vncserver 
# chkconfig vncserver on

# vi /etc/sysconfig/vncservers 

Edit the last two lines, uncommenting them, where myuser is a created user (usually ec2-user).

编辑最后两行,取消注释,myuser是创建的用户(通常是ec2用户)。

VNCSERVERS="2:myuser"  
VNCSERVERARGS[2]="-geometry 1280x1024"

Save changes.

保存更改。

Edit iptables:

编辑iptables:

# vi /etc/iptables

Add this line:

添加此行:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

Restart iptables:

重启iptables:

# service iptables restart

Next, edit the xstartup file:

接下来,编辑xstartup文件:

# vi /root/.vnc/xstartup

Make the last line be:

最后一行是:

exec  gnome-session

To finish:

完成:

  • Reboot the instance (to reset your vncserver services)
  • 重新启动实例(重置vncserver服务)
  • Ensure the amazon security group allows tcp 5902 traffic
  • 确保amazon安全组允许tcp 5902流量
  • Launch a VNC Viewer such as RealVNC's on your local computer
  • 在本地计算机上启动VNC Viewer,例如RealVNC
  • Connect to public_ip:5902
  • 连接到public_ip:5902

#2


4  

I don't know if it exits. But you can usually install a VNC server on any Linux installation, including existing AMIs. And then connect using a VNC client to get remote desktop.

我不知道它是否会退出。但您通常可以在任何Linux安装上安装VNC服务器,包括现有的AMI。然后使用VNC客户端连接以获取远程桌面。

Or use an NX server and client.

或者使用NX服务器和客户端。

Or even plain X protocol, but this will be very slow.

甚至是简单的X协议,但这将非常慢。

#3


2  

You can install GNOME on LINUX AMI's for GUI. You can also make use of NOMACHINE for this. If you are making use of Ubuntu AMI's follow steps mentioned below :

您可以在LINUX AMI上安装GNOME for GUI。您也可以使用NOMACHINE。如果您正在使用Ubuntu AMI,请按照以下步骤操作:

export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y ubuntu-desktop

#4


1  

You can check out the post here if you are interested in using Freenx to connect to an Amazon AMI using Fedora, CentOS, RHEL (or any other yum based distro).

如果您有兴趣使用Freenx连接到使用Fedora,CentOS,RHEL(或任何其他基于yum的发行版)的Amazon AMI,您可以在此处查看帖子。

#5


1  

Here are the instructions (thanks to Renan from AWS) I received May 2015.

以下是我2015年5月收到的指示(感谢来自AWS的Renan)。

  1. Launch a new, or use an existing, Ubuntu instance. I used Ubuntu 13.10 Saucy Salamander, 64-bit.10:08:04 AM
  2. 启动一个新的,或使用现有的Ubuntu实例。我使用了Ubuntu 13.10 Saucy Salamander,64位10:08:04 AM
  3. Update the system package list:10:08:04 AM sudo apt-get update10:08:04 AM
  4. 更新系统软件包列表:10:08:04 AM sudo apt-get update10:08:04 AM
  5. Optional - I recommend upgrading all installed packages, even the kernel. There may be reasons not to want this, however:10:08:04 AM sudo apt-get dist-upgrade10:08:04 AM
  6. 可选 - 我建议升级所有已安装的软件包,甚至是内核。可能有理由不想要这个,但是:10:08:04 AM sudo apt-get dist-upgrade10:08:04 AM
  7. Install LXDE and TightVNC (This will take a while, depending on the instance type):10:08:04 AM sudo apt-get install lxde tightvncserver10:08:04 AM
  8. 安装LXDE和TightVNC(这需要一段时间,具体取决于实例类型):10:08:04 AM sudo apt-get install lxde tightvncserver10:08:04 AM
  9. Reboot the system:10:08:04 AM sudo reboot10:08:04 AM
  10. 重启系统:10:08:04 AM sudo reboot10:08:04 AM
  11. Start up a VNC server (on localhost - since VNC itself isn't very secure, we'll use SSH)10:08:04 AM vncserver -geometry 1024x768 -depth 16 -localhost :110:08:04 AM Note: the VNC server will ask you to set and confirm a password. You will use this when you connect your VNC client.10:08:04 AM
  12. 启动VNC服务器(在localhost上 - 因为VNC本身不是很安全,我们将使用SSH)10:08:04 AM vncserver -geometry 1024x768 -depth 16 -localhost:110:08:04 AM注意:VNC服务器将要求您设置并确认密码。您将在连接VNC客户端时使用此功能.10:08:04 AM
  13. Install a suitable VNC viewer, such as TightVNC on Windows: http://www.tightvnc.com/download.php 10:08:04 AM or Remmina on Linux (usually installed by default, or at least available in the repositories).10:08:04 AM Sorry, I'm not sure what Mac users install for VNC, but apparently there's a Java-based viewer at least: http://www.tightvnc.com/faq.php#macosx 10:08:04 AM
  14. 在Windows上安装合适的VNC查看器,例如TightVNC:http://www.tightvnc.com/download.php 10:08:04 AM或Linux上的Remmina(通常默认安装,或者至少在存储库中可用)。 10:08:04 AM抱歉,我不确定Mac用户为VNC安装了什么,但显然至少有一个基于Java的查看器:http://www.tightvnc.com/faq.php#macosx 10:08: 04 AM
  15. Create an SSH tunnel:10:08:04 AM ssh -L 5901:localhost:5901 -N -f -i ubuntu@10:08:04 AM On Windows PuTTY, enter the usual settings (login, address, key file) then go to Connection > SSH > Tunnels and enter 5901 for Source Port and localhost:5901 for Destination, then click Add, and start your session.10:08:04 AM
  16. 创建SSH隧道:10:08:04 AM ssh -L 5901:localhost:5901 -N -f -i ubuntu @ 10:08:04 AM在Windows PuTTY上,输入常用设置(登录,地址,密钥文件)然后转到Connection> SSH> Tunnels并输入5901作为源端口,输入localhost:5901作为Destination,然后单击Add,然后启动会话.10:08:04 AM
  17. Finally, launch your VNC viewer and connect to localhost:5901, then enter the VNC password you chose earlier.10:08:04 AM
  18. 最后,启动您的VNC查看器并连接到localhost:5901,然后输入您之前选择的VNC密码.10:08:04 AM
  19. Enjoy your encrypted, remote Linux GUI.
  20. 享受加密的远程Linux GUI。

#1


16  

This works on RHEL 6.3 64-bit: (note: # means superuser and can be replaced by sudo)

这适用于RHEL 6.3 64位:(注意:#表示超级用户,可以用sudo替换)

# yum groupinstall "Desktop"    
# yum install tigervnc-server xorg-x11-fonts-Type1
# vncserver 
# chkconfig vncserver on

# vi /etc/sysconfig/vncservers 

Edit the last two lines, uncommenting them, where myuser is a created user (usually ec2-user).

编辑最后两行,取消注释,myuser是创建的用户(通常是ec2用户)。

VNCSERVERS="2:myuser"  
VNCSERVERARGS[2]="-geometry 1280x1024"

Save changes.

保存更改。

Edit iptables:

编辑iptables:

# vi /etc/iptables

Add this line:

添加此行:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

Restart iptables:

重启iptables:

# service iptables restart

Next, edit the xstartup file:

接下来,编辑xstartup文件:

# vi /root/.vnc/xstartup

Make the last line be:

最后一行是:

exec  gnome-session

To finish:

完成:

  • Reboot the instance (to reset your vncserver services)
  • 重新启动实例(重置vncserver服务)
  • Ensure the amazon security group allows tcp 5902 traffic
  • 确保amazon安全组允许tcp 5902流量
  • Launch a VNC Viewer such as RealVNC's on your local computer
  • 在本地计算机上启动VNC Viewer,例如RealVNC
  • Connect to public_ip:5902
  • 连接到public_ip:5902

#2


4  

I don't know if it exits. But you can usually install a VNC server on any Linux installation, including existing AMIs. And then connect using a VNC client to get remote desktop.

我不知道它是否会退出。但您通常可以在任何Linux安装上安装VNC服务器,包括现有的AMI。然后使用VNC客户端连接以获取远程桌面。

Or use an NX server and client.

或者使用NX服务器和客户端。

Or even plain X protocol, but this will be very slow.

甚至是简单的X协议,但这将非常慢。

#3


2  

You can install GNOME on LINUX AMI's for GUI. You can also make use of NOMACHINE for this. If you are making use of Ubuntu AMI's follow steps mentioned below :

您可以在LINUX AMI上安装GNOME for GUI。您也可以使用NOMACHINE。如果您正在使用Ubuntu AMI,请按照以下步骤操作:

export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y ubuntu-desktop

#4


1  

You can check out the post here if you are interested in using Freenx to connect to an Amazon AMI using Fedora, CentOS, RHEL (or any other yum based distro).

如果您有兴趣使用Freenx连接到使用Fedora,CentOS,RHEL(或任何其他基于yum的发行版)的Amazon AMI,您可以在此处查看帖子。

#5


1  

Here are the instructions (thanks to Renan from AWS) I received May 2015.

以下是我2015年5月收到的指示(感谢来自AWS的Renan)。

  1. Launch a new, or use an existing, Ubuntu instance. I used Ubuntu 13.10 Saucy Salamander, 64-bit.10:08:04 AM
  2. 启动一个新的,或使用现有的Ubuntu实例。我使用了Ubuntu 13.10 Saucy Salamander,64位10:08:04 AM
  3. Update the system package list:10:08:04 AM sudo apt-get update10:08:04 AM
  4. 更新系统软件包列表:10:08:04 AM sudo apt-get update10:08:04 AM
  5. Optional - I recommend upgrading all installed packages, even the kernel. There may be reasons not to want this, however:10:08:04 AM sudo apt-get dist-upgrade10:08:04 AM
  6. 可选 - 我建议升级所有已安装的软件包,甚至是内核。可能有理由不想要这个,但是:10:08:04 AM sudo apt-get dist-upgrade10:08:04 AM
  7. Install LXDE and TightVNC (This will take a while, depending on the instance type):10:08:04 AM sudo apt-get install lxde tightvncserver10:08:04 AM
  8. 安装LXDE和TightVNC(这需要一段时间,具体取决于实例类型):10:08:04 AM sudo apt-get install lxde tightvncserver10:08:04 AM
  9. Reboot the system:10:08:04 AM sudo reboot10:08:04 AM
  10. 重启系统:10:08:04 AM sudo reboot10:08:04 AM
  11. Start up a VNC server (on localhost - since VNC itself isn't very secure, we'll use SSH)10:08:04 AM vncserver -geometry 1024x768 -depth 16 -localhost :110:08:04 AM Note: the VNC server will ask you to set and confirm a password. You will use this when you connect your VNC client.10:08:04 AM
  12. 启动VNC服务器(在localhost上 - 因为VNC本身不是很安全,我们将使用SSH)10:08:04 AM vncserver -geometry 1024x768 -depth 16 -localhost:110:08:04 AM注意:VNC服务器将要求您设置并确认密码。您将在连接VNC客户端时使用此功能.10:08:04 AM
  13. Install a suitable VNC viewer, such as TightVNC on Windows: http://www.tightvnc.com/download.php 10:08:04 AM or Remmina on Linux (usually installed by default, or at least available in the repositories).10:08:04 AM Sorry, I'm not sure what Mac users install for VNC, but apparently there's a Java-based viewer at least: http://www.tightvnc.com/faq.php#macosx 10:08:04 AM
  14. 在Windows上安装合适的VNC查看器,例如TightVNC:http://www.tightvnc.com/download.php 10:08:04 AM或Linux上的Remmina(通常默认安装,或者至少在存储库中可用)。 10:08:04 AM抱歉,我不确定Mac用户为VNC安装了什么,但显然至少有一个基于Java的查看器:http://www.tightvnc.com/faq.php#macosx 10:08: 04 AM
  15. Create an SSH tunnel:10:08:04 AM ssh -L 5901:localhost:5901 -N -f -i ubuntu@10:08:04 AM On Windows PuTTY, enter the usual settings (login, address, key file) then go to Connection > SSH > Tunnels and enter 5901 for Source Port and localhost:5901 for Destination, then click Add, and start your session.10:08:04 AM
  16. 创建SSH隧道:10:08:04 AM ssh -L 5901:localhost:5901 -N -f -i ubuntu @ 10:08:04 AM在Windows PuTTY上,输入常用设置(登录,地址,密钥文件)然后转到Connection> SSH> Tunnels并输入5901作为源端口,输入localhost:5901作为Destination,然后单击Add,然后启动会话.10:08:04 AM
  17. Finally, launch your VNC viewer and connect to localhost:5901, then enter the VNC password you chose earlier.10:08:04 AM
  18. 最后,启动您的VNC查看器并连接到localhost:5901,然后输入您之前选择的VNC密码.10:08:04 AM
  19. Enjoy your encrypted, remote Linux GUI.
  20. 享受加密的远程Linux GUI。