Make Amazon Linux 2 (CentOS) GUI

Make Amazon Linux 2 (CentOS) GUI

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.

This goal

Make it available like the image below. yahooトップ画面.png

Prerequisite environment

--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

procedure

  1. Deploy EC2 and build an environment where you can connect with SSH
  2. Install GUI software (MATE), tigerVNC (VNC software), and Google chrome packages on EC2.
  3. Install Ultra VNC viewer on the client terminal
  4. Make a VNC connection from the client terminal to EC2

I actually tried it

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

ec2-Set a 6-8 character VNC-specific password for user.

vncpasswd

When prompted to enter a display-only password, press "n".

Start the VNC server with display number 1.

vncserver :1 

Copy the vncserver systemd unit created by default and create another new systemd unit.

sudo cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]

Replace all statements in the new unit with the actual user (ec2-user).

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.

First, set the Japanese localization of the desktop environment. Install IME ibus and Japanese font google-noto-sans-japanese-fonts so that you can enter Japanese.

sudo yum install ibus-kkc
sudo yum install google-noto-sans-japanese-fonts    

ibus settings are described in bashrc.

vi ~/.bashrc

Add the following to the end of the file to save the file.

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

Describe the following in the file contents.

[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

Check if the installation was successful.

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. Veiwer_ログイン.png

vnc_ログイン後画面.png It is OK if it is displayed like this. Then launch Google Chrome. google_アクセス.png

I think I can surf the internet safely. This completes the settings.

Finally

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.

Referenced website

Procedure to install GUI desktop environment (MATE) on Amazon Linux2 Tutorial for building a scraping environment with CentOS7 x Chrome AWS Official

Recommended Posts

Make Amazon Linux 2 (CentOS) GUI
Linux (CentOS) construction
OpenVPN Summary + Amazon Linux2
About Linux environment construction (CentOS)
Addition of amazon linux swap
Install tomcat 5.5 on Amazon Linux.
Make HTTPS for free with Amazon Linux2 + Freenom + Let's Encrypt
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
Run Amazon Linux 2 in VirtualBox
Install Nginx anyway (AWS Amazon Linux 2, CentOS7 compatible, official ref. Available)
Prepare pipenv environment with amazon Linux 2
Make your own manual. [Linux] [man]
Install oracle java8 on amazon linux2
Let's make a GUI with python.
Try installing OpenAM on Amazon Linux
How to install wkhtmltopdf (Amazon Linux2)
Install pyenv on EC2 (Amazon Linux)
[Linux] I installed CentOS on VirtualBox
Make Live USB on Alpine Linux
Introducing Amplify to Amazon Linux 2 AMI
[Note] Install Imagick on Amazon Linux2
[Note] Run Django on Amazon Linux 2
Teamviewer for Linux installation procedure (CentOS)
Run docker-compose on Amazon Linux2 on ARM64
Introduce Python 3.5.2 environment on Amazon Linux
Linux server construction link summary (CentOS7)
Using Kali Linux Gui with WSL2
Run cron on Amazon Linux (set on Linux)