linux:vnc

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:vnc [2022/08/28 05:20] – [参考文献] ともやんlinux:vnc [2023/09/01 12:54] (現在) – [インストール] ともやん
行 1: 行 1:
 ====== VNC(Virtual Network Computing) ====== ====== VNC(Virtual Network Computing) ======
 +{{:linux:tigervnc_001.png?600|TigerVNC 001}}\\
 +
  VNC(Virtual Network Computing)は、リモートデスクトップを実現するクロスプラットフォームのソフトウェアである。\\  VNC(Virtual Network Computing)は、リモートデスクトップを実現するクロスプラットフォームのソフトウェアである。\\
 VNCサーバが動作するOS(Windows CE/98/Me/2000/XP/2003、Linux、Solaris)をVNCクライアントが動作する\\ VNCサーバが動作するOS(Windows CE/98/Me/2000/XP/2003、Linux、Solaris)をVNCクライアントが動作する\\
行 10: 行 12:
  
 ==== インストール ==== ==== インストール ====
 +tigervnc-server パッケージをインストールする🤔\\
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ sudo yum install tigervnc-server+<b class=GRN>$</b> <b class=HIY>sudo</b> dnf install tigervnc-server
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result_long><html><pre> <WRAP color_result_long><html><pre>
行 58: 行 61:
 </WRAP> </WRAP>
  
 +現在のファイヤウォールの内容を確認する🤔\\
 +[[linux:commands:network:firewall-cmd|firewalld (Linux)]]\\
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ firewall-cmd --list-services+<b class=GRN>$</b> <b class=HIY>firewall-cmd</b> --list-services
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 dhcpv6-client mdns samba-client ssh dhcpv6-client mdns samba-client ssh
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
 +
 +vnc-server のファイヤウォール定義は以下のようになっている🤔\\
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ cat /usr/lib/firewalld/services/vnc-server.xml +<b class=GRN>$</b> <b class=HIY>cat</b> /usr/lib/firewalld/services/vnc-server.xml 
 </pre></html></WRAP> </pre></html></WRAP>
-<WRAP color_result><html><pre>+<WRAP color_code mincode><code xml>
 <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
 <service> <service>
行 75: 行 84:
   <port protocol="tcp" port="5900-5903"/>   <port protocol="tcp" port="5900-5903"/>
 </service> </service>
-</pre></html></WRAP>+</code></WRAP> 
 +</WRAP
 + 
 +ファイヤウォールに vnc-server の設定を行う🤔\\ 
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ sudo firewall-cmd --permanent --add-service=vnc-server+<b class=GRN>$</b> <b class=HIY>sudo</b> firewall-cmd --permanent --add-service=vnc-server
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 success success
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
 +
 +ファイヤウォール設定を有効化するためにリロードする🤔\\
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ sudo firewall-cmd --reload+<b class=GRN>$</b> <b class=HIY>sudo</b> firewall-cmd --reload
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 success success
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
 +
 +設定が適用されていることを確認する🤔\\
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ firewall-cmd --list-services+<b class=GRN>$</b> <b class=HIY>firewall-cmd</b> --list-services
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 dhcpv6-client mdns samba-client ssh vnc-server dhcpv6-client mdns samba-client ssh vnc-server
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
  
 +VNC 接続時に適用されるデフォルト設定を行う(例: GNOME セッション、解像度 1366x768)\\
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-echo "session=gnome" | sudo tee -a /etc/tigervnc/vncserver-config-defaults+<b class=GRN>$</b> <b class=HIY>cat</b> &lt;&lt; "EOF" | sudo tee -a /etc/tigervnc/vncserver-config-defaults 
 +session=gnome 
 +geometry=1366x768 
 +EOF
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 session=gnome session=gnome
 +geometry=1366x768
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
  
 +画面番号 :1 のログインユーザーを設定する(例: tomoyan)🤔\\
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ echo ":1=tomoyan" | sudo tee -a /etc/tigervnc/vncserver.users+<b class=GRN>$</b> <b class=HIY>echo</b> ":1=tomoyan" | sudo tee -a /etc/tigervnc/vncserver.users
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
 :1=tomoyan :1=tomoyan
 </pre></html></WRAP> </pre></html></WRAP>
 +</WRAP>
  
 +VNC 接続時パスワードを設定する(この設定を行わないとサービスが起動出来ない)🤔\\
 +<WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-sudo systemctl enable --now vncserver@:+<b class=GRN>$</b> <b class=HIY>vncpasswd</b>
-$ systemctl status vncserver@:1.service+
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
-○ vncserver@:1.service - Remote desktop service (VNC) +Password
-     Loadedloaded (/usr/lib/systemd/system/vncserver@.service; enabled; vendor preset: disabled+Verify: 
-     Active: inactive (dead) since Sun 2022-08-28 04:44:43 JST; 6s ago +Would you like to enter a view-only password (y/n)? n 
-    Process: 14000 ExecStartPre=/usr/libexec/vncsession-restore :1 (code=exited, status=0/SUCCESS) +A view-only password is not used 
-    Process: 14009 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS) +</pre></html></WRAP> 
-   Main PID: 14016 (code=exited, status=0/SUCCESS) +</WRAP>
-        CPU: 35ms+
  
- 8月 28 04:44:43 WICKED-BEAT systemd[1]: Starting vncserver@:1.service - Remote desktop service (VNC)... +vnc-server サービスの有効化と起動を行い、正常に起動することを確認する😀\\ 
- 8月 28 04:44:43 WICKED-BEAT systemd[1]: Started vncserver@:1.service - Remote desktop service (VNC). +<WRAP color_term> 
- 8月 28 04:44:43 WICKED-BEAT systemd[1]: vncserver@:1.service: Deactivated successfully.+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> systemctl enable --now vncserver@:
 +<b class=GRN>$</b> <b class=HIY>systemctl</b> status vncserver@:1.service
 </pre></html></WRAP> </pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +<b class=GRN>●</b> vncserver@:1.service - Remote desktop service (VNC)
 +     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; <b class=GRN>enabled</b>; vendor preset: <b class=YEL>disabled</b>)
 +     Active: <b class=GRN>active (running)</b> since Fri 2022-10-07 10:26:31 JST; 1min 29s ago
 +    Process: 2756 ExecStartPre=/usr/libexec/vncsession-restore :1 (code=exited, status=0/SUCCESS)
 +    Process: 2768 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
 +   Main PID: 2775 (vncsession)
 +      Tasks: 0 (limit: 19016)
 +     Memory: 1016.0K
 +        CPU: 38ms
 +     CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
 +             ‣  2775 /usr/sbin/vncsession tomoyan :1
  
 +10月 07 10:26:31 WICKED-BEAT systemd[1]: Starting vncserver@:1.service - Remote desktop service (VNC)...
 +10月 07 10:26:31 WICKED-BEAT systemd[1]: Started vncserver@:1.service - Remote desktop service (VNC).
 +</pre></html></WRAP>
 +</WRAP>
 +
 +==== Remmina で実際に接続確認を行う ====
 +[[linux:remmina|Remmina リモートデスクトップ]] を参照。\\
 +{{:linux:tigervnc_001.png?800|TigerVNC 001}}\\
 +
 +==== vncserver が起動しない場合...😥 ====
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=HIY>systemctl</b> status vncserver@:1.service
 +<WRAP color_result><html><pre>
 +<b class=GRN>●</b> vncserver@:1.service - Remote desktop service (VNC)
 +     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; <b class=GRN>enabled</b>; preset: <b class=GRN>disabled</b>)
 +     Active: inactive (dead) since Sat 2023-03-04 16:24:58 JST; 25s ago
 +   Duration: 1.083s
 +    Process: 3001 ExecStartPre=/usr/libexec/vncsession-restore :1 (code=exited, status=0/SUCCESS)
 +    Process: 3010 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
 +   Main PID: 3017 (code=exited, status=0/SUCCESS)
 +        CPU: 56ms
 +
 + 3月 04 16:24:57 highway-x.fireball.local systemd[1]: Starting vncserver@:1.service - Remote desktop service >
 + 3月 04 16:24:57 highway-x.fireball.local systemd[1]: Started vncserver@:1.service - Remote desktop service (>
 + 3月 04 16:24:58 highway-x.fireball.local systemd[1]: vncserver@:1.service: Deactivated successfully.
 +</pre></html></WRAP>
 +</WRAP>
 +
 +vnc パスワードの設定をしていない可能性があるので設定する🤔\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=HIY>vncpasswd</b>
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +Password:
 +Verify:
 +Would you like to enter a view-only password (y/n)? n
 +A view-only password is not used
 +</pre></html></WRAP>
 +</WRAP>
 +
 +vncserver を起動し直してステータスを確認する🤔\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=HIY>sudo</b> systemctl start vncserver@:1
 +<b class=GRN>$</b> <b class=HIY> systemctl</b> status vncserver@:1.service
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +<b class=GRN>●</b> vncserver@:1.service - Remote desktop service (VNC)
 +     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; <b class=GRN>enabled</b>; preset: <b class=GRN>disabled</b>)
 +     Active: <b class=GRN>active (running)</b> since Sat 2023-03-04 16:31:50 JST; 3s ago
 +    Process: 3220 ExecStartPre=/usr/libexec/vncsession-restore :1 (code=exited, status=0/SUCCESS)
 +    Process: 3232 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
 +   Main PID: 3239 (vncsession)
 +      Tasks: 0 (limit: 9402)
 +     Memory: 1.0M
 +        CPU: 67ms
 +     CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
 +             ‣ 3239 /usr/sbin/vncsession tomoyan :1
 +
 + 3月 04 16:31:50 highway-x.fireball.local systemd[1]: Starting vncserver@:1.service - Remote desktop service >
 + 3月 04 16:31:50 highway-x.fireball.local systemd[1]: Started vncserver@:1.service - Remote desktop service (>
 +</pre></html></WRAP>
 </WRAP> </WRAP>
  
  • linux/vnc.1661631620.txt.gz
  • 最終更新: 2022/08/28 05:20
  • by ともやん