0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ubuntu 超初心者向け設定 VNCアクセスできるようになるまで

Last updated at Posted at 2021-01-29

###################################################
ubuntu 20.04 x11vnc
###################################################

gdm3からlightdmに変更
sudo apt install lightdm

x11vnc をインストール

パスワードを設定
sudo x11vnc -storepasswd /etc/.vncpasswd

Xauthority の場所を探す
ps wwwwaux | grep auth
-auth /run/user/1000/gdm/Xauthority

コマンドを打って起動、接続確認する
sudo x11vnc -rfbauth /etc/.vncpasswd -loop -forever -repeat -rfbport 5900 -shared -display :0 -auth /run/user/1000/gdm/Xauthority

サービスに登録する
sudo vi /etc/systemd/system/x11vnc.service

demo@demo-S2600WT2R:~$ cat /etc/systemd/system/x11vnc.service
[Unit]
Description=x11vnc (Remote access)
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -rfbauth /etc/.vncpasswd -loop -forever -repeat -rfbport 5900 -shared -display :0 -auth guess
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
KillMode=control-group
Restart=on-failure

[Install]
WantedBy=graphical.target

サービスコンフィグファイルが書き換わったので一度デーモンを再起動
systemctl daemon-reload

x11vncのサービススタート
systemctl start x11vnc

登録
systemctl enable x11vnc

###################################################
ubuntu 18 + tivervncserver
###################################################
ubuntu 18.04.x Serverをインストールする
SSHサーバーも同時にインストール
もしくは sudo apt-get install openssh-server

IPを設定

reboot

Ubuntuバージョン確認
cat /etc/lsb-release or lsb_release -a

ーーー以下すべてsudoコマンドーーー

vi /etc/ssh/sshd_config Rootのアクセスを許可
systemctl restart ssh

ufw
ufw allow 22

apt-get update

apt-get -y install ubuntu-desktop 昔はUnityが標準だったが今はGnomeが標準

gnome-shell --version

apt-get install tightvncserver (もしくはtigervncserver こちらの方がtightの改良版らしい)

apt list or apt search
dpkg -l
apt remove or apt remove --purge

vncserver でアクセス時のパスワード設定 6-8文字

うまくいかないのでtigervnc にチェンジ

apt-get install tigervnc-standalone-server tigervnc-common tigervnc-xorg-extension
vncpasswd

vncserver -localhost no -geometry 1920x1080 -depth 24

アクセスはVNCクライアントで vncserver-IP:5901

vncserver -list
vncserver -kill :1

自動起動は以下の記事が参考になりました。
https://www.it-swarm-ja.tech/ja/ubuntu/ubuntu-1804でのtigervnc-systemdプロセスの設定/962276367/

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?