User Tools

Site Tools


windows_subsystem_for_linux:wsl2:デスクトップ環境の設定

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
windows_subsystem_for_linux:wsl2:デスクトップ環境の設定 [2020/12/01 20:57]
koudai [シェルスクリプト]
windows_subsystem_for_linux:wsl2:デスクトップ環境の設定 [2021/06/27 22:04] (current)
Line 1: Line 1:
 ====== 概要 ====== ====== 概要 ======
  
-UbuntuをGUI環境で使います+  * UbuntuをGUI環境で使います 
 +  * 動作が重いのであまり実用的でないかもしれません 
 +  * Virtual Boxを使うか、次の大型アップデートを待ちましょう(参考:https://japan.zdnet.com/article/35160162/
  
  
Line 22: Line 24:
 </code> </code>
   - (GUIでパッケージのアップデートやインストールを行いたい場合)PolicyKitの設定をします<code>   - (GUIでパッケージのアップデートやインストールを行いたい場合)PolicyKitの設定をします<code>
-sudo sh -c 'cat <<EOL > /etc/polkit-1/localauthority/50-local.d/99-all.pkla+sudo su 
 +# vi /etc/polkit-1/localauthority/50-local.d/99-all.pkla 
 +</code><file - 99-all.pkla>
 [Allow all] [Allow all]
 Identity=unix-user:* Identity=unix-user:*
Line 29: Line 33:
 ResultInactive=yes ResultInactive=yes
 ResultActive=yes ResultActive=yes
-EOL' +</file>
-</code>+
   - いったん終了して、再起動します<code>   - いったん終了して、再起動します<code>
 $ exit $ exit
Line 89: Line 92:
 XDG_CURRENT_DESKTOP=ubuntu:GNOME XDG_SESSION_TYPE=x11 gnome-session XDG_CURRENT_DESKTOP=ubuntu:GNOME XDG_SESSION_TYPE=x11 gnome-session
 </file> </file>
 +
 +  * (2021年2月追記)上のスクリプトでは起動できなくなったので、次のように書き換えてください<file bash start.sh>
 +#!/bin/bash
 +
 +sudo sh -c 'dbus-uuidgen > /var/lib/dbus/machine-id'
 +sudo service dbus restart
 +export DISPLAY="$(cat /etc/resolv.conf|grep nameserver|awk '{print $2}'):0"
 +/mnt/c/Program\ Files/VcXsrv/vcxsrv.exe :0 -ac -keyhook &
 +XDG_CURRENT_DESKTOP=ubuntu:GNOME XDG_SESSION_TYPE=x11 gnome-session
 +/mnt/c/Windows/System32/taskkill.exe /IM vcxsrv.exe /T /F
 +</file>
 +
 シェルスクリプトができたら実行権限を付与します。 シェルスクリプトができたら実行権限を付与します。
 <code> <code>
windows_subsystem_for_linux/wsl2/デスクトップ環境の設定.1606823858.txt.gz · Last modified: 2021/06/27 22:01 (external edit)