![]() ![]() WSL normally boots a minimal version of the system, without systemd. Just repeat this step if this happens, and Xvnc will work again as Xorg replacement. Also, you can change the -PasswordFile option to point to a fixed location instead the home of current user, so you don't need to have a password for each user.įinally, we set the correct permissions for the file and create a link to it: sudo chmod 0755 /usr/bin/Xorg_newĪttention: sometimes, system updates replace Xorg link with the original version. You can change that to fit your needs (1366x768, 1920x1080, etc). # Here you can change or add options to fit your needsĬommand=("/usr/bin/Xvnc" "-geometry" "1024x768" "-PasswordFile" "$/.vnc/passwd" -t /usr/bin/Xorg echo "Starting Xvnc:" note the resolution of the virtual screen. # -novtswitch is not supported at all by Xvnc # -keeptty is not supported at all by Xvnc Paste the following content in the editor (remember, WSL shell uses CTRL + SHIFT + V for pasting, instead our traditional CTRL + V key combination): #!/bin/bash This IS the real magic we are trying to do.įirst, let's backup the original Xorg script. So we will replace Xorg script by a new version which calls Xvnc instead the classic X/Xorg. You can repeat the process for other existing users.īy default, the display manager call multiple X instances, one for each user session, including the login screen, provided by gdm. Tip: In Debian, the GDM user is Debian-gdm. Now, let's configure the VNC password for root (needed if you use LightDM instead GDM): sudo -H vncpasswdįinally, let's configure the VNC password for GDM (you need to skip this step if you didn't install GNOME): sudo -H -u gdm vncpasswd First, let's configure the VNC password current user: vncpasswd If you don't configure the password, you won't able to access the login screen, or the user's desktop. So you have to configure at least three passwords, one for the current user, other for root, and other for gdm, who whill present the login screen. In this setup, each user has a different VNC password. Configuring the environment Creating VNC Server passwords ![]() The installation process is finally done. Pretty easy, one command and you are done: sudo apt install tigervnc-standalone-server The installation will take a while, so be patient. Use spacebar to select the package, and Tab to confirm your choice. sudo taskselĪt the package list, select your favorite GUI package. Ubuntu has a handy component installer called tasksel, but it's not installed by default. If you are trying to use Debian, you also will need: sudo apt install curl wget Don't forget to reboot your computer after disabling WSLg, just shutting WSL down is not enough to bring WSLg down.īefore going to real business, let's make sure we are updated. You can make them coexist, but it's painful. Then you must disable WSLg, because unfortunately it messes with the graphical internal workings of Linux. ![]() First, we need a working WSL2 installation. Check the Sample screenshots section for examples. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. The key component we need to install is tigervnc-standalone-server.įor this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer ( RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly). In this tutorial, we will setup GUI in WSL2, and access it using VNC. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |