我知道AWS上的EC2等云实例安装的Linux操作系统很少,因此无法通过任何远程桌面协议(如VNC)使用UI。
我想知道是否有任何方法可以在我的AWS / EC2上安装标准的ubuntu UI,然后我可以使用某些远程桌面协议进行访问?
是的,您可以安装xfce并使用远程系统上的VNC查看器来使用它。
您需要按照以下步骤操作:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vnc4server
sudo apt-get install gnome-core xfce4 xfce4-goodies firefox nano -y --force-yes
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
vim ~/.vnc/xstartup
将这些行粘贴到其中
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
sudo chmod +x ~/.vnc/xstartup
sudo vim /etc/init.d/vncserver
将以下代码粘贴到其中:
#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="user"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
. /lib/lsb/init-functions
case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
stop)
log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
sudo chmod +x /etc/init.d/vncserver
sudo service vncserver start
ssh -L 5901:127.0.0.1:5901 -N -f -l user server_ip_address
sudo update-rc.d vncserver defaults
这些指南是一个很好的帮助。