linux:vnc

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:vnc [2013/10/16 00:14] – [設定と反映] ともやん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クライアントが動作する\\
 OS(Windows CE/98/Me/2000/XP/2003、Linux、Solaris、Javaが作動する全てのOS、μVNCやiVNCは携帯用)\\ OS(Windows CE/98/Me/2000/XP/2003、Linux、Solaris、Javaが作動する全てのOS、μVNCやiVNCは携帯用)\\
-から遠隔操作することができる。+から遠隔操作することができる。\\ 
 + 
 +[[wwjp>Virtual_Network_Computing|Virtual Network Computing | Wikiwand]] も参照\\ 
 + 
 +===== TigerVNC (Tiger Virtual Network Computing) ===== 
 + 
 +==== インストール ==== 
 +tigervnc-server パッケージをインストールする🤔\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> dnf install tigervnc-server 
 +</pre></html></WRAP> 
 +<WRAP color_result_long><html><pre> 
 +メタデータの期限切れの最終確認: 0:16:48 時間前の 2022年08月28日 04時04分24秒 に実施しました。 
 +依存関係が解決しました。 
 +======================================================================================================================== 
 + パッケージ                       アーキテクチャー       バージョン                       リポジトリー            サイズ 
 +======================================================================================================================== 
 +インストール: 
 + <b class=GRN>tigervnc-server</b>                  x86_64                 1.12.0-6.fc36                    updates                 259 k 
 +依存関係のインストール: 
 + <b class=GRN>tigervnc-selinux</b>                 noarch                 1.12.0-6.fc36                    updates                  24 k 
 + 
 +トランザクションの概要 
 +======================================================================================================================== 
 +インストール  2 パッケージ 
 + 
 +ダウンロードサイズの合計: 284 k 
 +インストール後のサイズ: 682 k 
 +これでよろしいですか? [y/N]: y 
 +パッケージのダウンロード: 
 +(1/2): tigervnc-selinux-1.12.0-6.fc36.noarch.rpm                                         32 kB/s |  24 kB     00:00     
 +(2/2): tigervnc-server-1.12.0-6.fc36.x86_64.rpm                                          70 kB/s | 259 kB     00:03     
 +------------------------------------------------------------------------------------------------------------------------ 
 +合計                                                                                     60 kB/s | 284 kB     00:04      
 +トランザクションの確認を実行中 
 +トランザクションの確認に成功しました。 
 +トランザクションのテストを実行中 
 +トランザクションのテストに成功しました。 
 +トランザクションを実行中 
 +  準備             :                                                                                                1/1  
 +  scriptletの実行中: tigervnc-selinux-1.12.0-6.fc36.noarch                                                          1/2  
 +  インストール中   : tigervnc-selinux-1.12.0-6.fc36.noarch                                                          1/2  
 +  scriptletの実行中: tigervnc-selinux-1.12.0-6.fc36.noarch                                                          1/2  
 +  インストール中   : tigervnc-server-1.12.0-6.fc36.x86_64                                                           2/2  
 +  scriptletの実行中: tigervnc-server-1.12.0-6.fc36.x86_64                                                           2/2  
 +  検証             : tigervnc-selinux-1.12.0-6.fc36.noarch                                                          1/2  
 +  検証             : tigervnc-server-1.12.0-6.fc36.x86_64                                                           2/2  
 + 
 +インストール済み: 
 +  tigervnc-selinux-1.12.0-6.fc36.noarch                       tigervnc-server-1.12.0-6.fc36.x86_64                       
 + 
 +完了しました! 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +現在のファイヤウォールの内容を確認する🤔\\ 
 +[[linux:commands:network:firewall-cmd|firewalld (Linux)]]\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>firewall-cmd</b> --list-services 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +dhcpv6-client mdns samba-client ssh 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +vnc-server のファイヤウォール定義は以下のようになっている🤔\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>cat</b> /usr/lib/firewalld/services/vnc-server.xml  
 +</pre></html></WRAP> 
 +<WRAP color_code mincode><code xml> 
 +<?xml version="1.0" encoding="utf-8"?> 
 +<service> 
 +  <short>Virtual Network Computing Server (VNC)</short> 
 +  <description>A VNC server provides an external accessible X session. Enable this option if you plan to provide a VNC server with direct access. The access will be possible for displays :0 to :3. If you plan to provide access with SSH, do not open this option and use the via option of the VNC viewer.</description> 
 +  <port protocol="tcp" port="5900-5903"/> 
 +</service> 
 +</code></WRAP> 
 +</WRAP> 
 + 
 +ファイヤウォールに vnc-server の設定を行う🤔\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> firewall-cmd --permanent --add-service=vnc-server 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +success 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +ファイヤウォール設定を有効化するためにリロードする🤔\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>sudo</b> firewall-cmd --reload 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +success 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +設定が適用されていることを確認する🤔\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>firewall-cmd</b> --list-services 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +dhcpv6-client mdns samba-client ssh vnc-server 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +VNC 接続時に適用されるデフォルト設定を行う(例: GNOME セッション、解像度 1366x768)\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<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> 
 +<WRAP color_result><html><pre> 
 +session=gnome 
 +geometry=1366x768 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +画面番号 :1 のログインユーザーを設定する(例: tomoyan)🤔\\ 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=HIY>echo</b> ":1=tomoyan" | sudo tee -a /etc/tigervnc/vncserver.users 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +:1=tomoyan 
 +</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> 
 + 
 +vnc-server サービスの有効化と起動を行い、正常に起動することを確認する😀\\ 
 +<WRAP color_term> 
 +<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> 
 +<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@:
 +<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>
  
 ===== Xvnc の設定(xinetd 編) ===== ===== Xvnc の設定(xinetd 編) =====
行 15: 行 249:
   - リモートデスクトップ(vnc)のパッケージをインストールする。\\ **CentOS**<code>   - リモートデスクトップ(vnc)のパッケージをインストールする。\\ **CentOS**<code>
 $ sudo yum install vnc vnc-server $ sudo yum install vnc vnc-server
-</code>**Fedora**<code>+</code>**Fedora**\\ <WRAP color_term> 
 +<WRAP color_command><html><pre>
 $ sudo yum install tigervnc-server-minimal $ sudo yum install tigervnc-server-minimal
-</code>+</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +メタデータの期限切れの最終確認: 3:23:49 時間前の 2022年08月28日 00時36分21秒 に実施しました。 
 +パッケージ tigervnc-server-minimal-1.12.0-6.fc36.x86_64 は既にインストールされています。 
 +依存関係が解決しました。 
 +行うべきことはありません。 
 +完了しました! 
 +</pre></html></WRAP> 
 +</WRAP> 
 ==== 設定と反映 ==== ==== 設定と反映 ====
   - サービスのポートを指定するために、以下の設定ファイルを修正する。(行追加)\\ <code>   - サービスのポートを指定するために、以下の設定ファイルを修正する。(行追加)\\ <code>
行 81: 行 325:
 $ sudo service xinetd restart $ sudo service xinetd restart
 $ sudo service iptables restart $ sudo service iptables restart
 +</code>Fedora 16<code>
 +$ sudo systemctl restart xinetd.service
 </code>Fedora 18 以降<code> </code>Fedora 18 以降<code>
 $ sudo systemctl restart gdm.service $ sudo systemctl restart gdm.service
行 226: 行 472:
 $ sudo firewall-cmd --reload $ sudo firewall-cmd --reload
 </code> </code>
-==== 参考文献 ==== +
-[[http://mo.kerosoft.com/0123|VNC Serverをxinetd経由で立てる方法 [Fedora 10] - Kerosoft : Modus Operandi]]\\ +
-[[http://iseebi.half-done.net/?TechDoc%2FRemoteDesktopWithxinetd|伊勢的新常識 - xinetd + VNC でリモートデスクトップ]]\\ +
-[[http://qx-xp.net/VNCserver.aspx|VNC-server]]\\ +
-[[http://www.fedoraforum.org/forum/archive/index.php/t-1606.html|Vnc & Gdm [Archive] - FedoraForum.org]]\\ +
-[[http://codeghar.wordpress.com/2009/06/11/remote-login-with-gdm-and-vnc-on-fedora-11/|Remote Login with GDM and VNC on Fedora 11 << Code Ghar]]¥¥+
 ===== VNCサーバの設定(vncserver サービス編) ===== ===== VNCサーバの設定(vncserver サービス編) =====
  この方法では、ユーザー1人につきポート5901より1ポートを消費します。また、VNCSERVERARGSの定義数が増えるとメモリーを多く消費します。\\  この方法では、ユーザー1人につきポート5901より1ポートを消費します。また、VNCSERVERARGSの定義数が増えるとメモリーを多く消費します。\\
行 303: 行 544:
 ... ...
 </code> </code>
 +
 +===== 参考文献 =====
 +[[https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-tigervnc|第13章 TigerVNC Red Hat Enterprise Linux 7 | Red Hat Customer Portal]]\\
 +[[https://www.server-world.info/query?os=Fedora_34&p=desktop&f=6|Fedora 34 : VNC サーバーの設定 : Server World]]\\
 +[[qita>taconana/items/8a9b07ea686d68587281|CentOS8.3でVNCサーバをセットアップする手順 - Qiita]]\\
 +[[http://mo.kerosoft.com/0123|VNC Serverをxinetd経由で立てる方法 [Fedora 10] - Kerosoft : Modus Operandi]]\\
 +[[http://iseebi.half-done.net/?TechDoc%2FRemoteDesktopWithxinetd|伊勢的新常識 - xinetd + VNC でリモートデスクトップ]]\\
 +[[http://qx-xp.net/VNCserver.aspx|VNC-server]]\\
 +[[http://www.fedoraforum.org/forum/archive/index.php/t-1606.html|Vnc & Gdm [Archive] - FedoraForum.org]]\\
 +[[http://codeghar.wordpress.com/2009/06/11/remote-login-with-gdm-and-vnc-on-fedora-11/|Remote Login with GDM and VNC on Fedora 11 << Code Ghar]]\\
 +
  • linux/vnc.1381850043.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)