This time, I will install Mate on Amazon Linux 2 (CentOS 7) and make it a GUI. Just making it a GUI is not good, so I would like to install Google Chrome so that I can surf the Internet. Also, I would like to be able to access the Internet with Google chrome and browse websites like Windows instead of command operation.
Make it available like the image below.
--The EC2 AMI to be used is Amazon Linux2 (CentOS) --EC2 sets a security group so that it can be accessed by SSH and VNC from a client terminal (Windows 10 at home) --VNC software uses tigerVNC --For desktop environment, install and use MATE (reading: mate) --Install UltraVNC viewer on VNC client --The user used for VNC login is ec2-user
There are many detailed articles about 1., so I will omit it. Let's start with 2. First, connect to EC2 with SSH, and the user will proceed with ec2-user.
Install the #MATE package. sudo amazon-linux-extras install mate-desktop1.x
Define #MATE as the default desktop. It also defines MATE for all users. sudo bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop'
Install #TigerVNC. sudo yum install tigervnc-server
vncpasswd
When prompted to enter a display-only password, press "n".
vncserver :1
sudo cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]
sudo sed -i 's/<USER>/ec2-user/' /etc/systemd/system/[email protected]
#systemd Reloads the manager settings. sudo systemctl daemon-reload
#Enable the service. sudo systemctl enable vncserver@:1
#Start the service. sudo systemctl start vncserver@:1
The GUI setting is now the environment. However, it is written in English as it is, and since Google chrome is not installed, we will Japaneseize the desktop environment and install Google chrome.
sudo yum install ibus-kkc
sudo yum install google-noto-sans-japanese-fonts
vi ~/.bashrc
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
ibus-daemon -drx
#Change the locale setting. sudo localectl set-locale LANG=ja_JP.UTF-8
#Reboot to reflect the setting change. reboot
This completes Japanese. Next, install the Google Chrome package. From here on, execute the command as a user with root privileges.
#Create a repository file. sudo vi /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
Update # yum sudo yum update
#Install the package. sudo yum install google-chrome-stable
google-chrome --version
If the version is displayed, it's OK.
This completes all the settings made on the EC2 side. After that, install VNC viewer on the client terminal and try accessing it.
Install UltraVNC viewer from the following site. Window Company
Launch Ultra VNC viewer Enter in the format ["ELastic IP address": 5901] and enter the registered PW.
It is OK if it is displayed like this. Then launch Google Chrome.
I think I can surf the internet safely. This completes the settings.
Even with 1GB of memory, it works smoothly (laughs). After all Linux is light! It may be convenient when you cannot surf the network directly from your PC due to various reasons.
Procedure to install GUI desktop environment (MATE) on Amazon Linux2 Tutorial for building a scraping environment with CentOS7 x Chrome AWS Official
Recommended Posts