other:win10_wsl_1
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
other:win10wsl [2020/08/21 16:36] – [Configuration (in your local Linux account)] jypeter | other:win10wsl [2022/08/08 18:02] – [Installing an X server] Moved and improved the X server stuff to a new page jypeter | ||
---|---|---|---|
Line 9: | Line 9: | ||
The user can choose to install Linux using WSL1 or WSL2. Check the [[https:// | The user can choose to install Linux using WSL1 or WSL2. Check the [[https:// | ||
- | Read just the top of the [[https:// | + | |
+ | ===== What is WSL ? ===== | ||
+ | |||
+ | Useful reading: | ||
+ | * Have a look at the beginning | ||
+ | * Read [[https:// | ||
+ | * There is more useful information on the // | ||
In a few words, WSL is not Linux, it's more a way to [[https:// | In a few words, WSL is not Linux, it's more a way to [[https:// | ||
Line 75: | Line 81: | ||
There are several ways to open a default terminal: | There are several ways to open a default terminal: | ||
- | * select | + | * Select |
- | * click on the //Ubuntu// icon on the task bar | + | * Click on the //Ubuntu// icon on the task bar |
* if you don't have a //Ubuntu// icon on the task bar yet: right-click on the //Ubuntu// icon (in the '' | * if you don't have a //Ubuntu// icon on the task bar yet: right-click on the //Ubuntu// icon (in the '' | ||
* to open more terminals: right-click on the //Ubuntu// icon on the task bar -> Ubuntu | * to open more terminals: right-click on the //Ubuntu// icon on the task bar -> Ubuntu | ||
- | * type '' | + | * Type '' |
== Copy/paste in the default terminal == | == Copy/paste in the default terminal == | ||
Line 92: | Line 98: | ||
=== The WSLtty terminal === | === The WSLtty terminal === | ||
- | <note tip>This is the recommended (by JYP) option for now</ | + | <note tip> |
+ | * This is the recommended (by JYP) option for now | ||
+ | |||
+ | * If you can't open a terminal after Windows upgrades from WSL to WSL v2, get and install the latest version of WSLtty ! | ||
+ | </ | ||
[[https:// | [[https:// | ||
* Download and execute the latest [[https:// | * Download and execute the latest [[https:// | ||
- | * You will then have different | + | * After installing, you will get several |
- | * //WSL terminal// shorcut | + | * Double-click on the '' |
- | * //Ubuntu terminal// and //WSL Terminal// in the '' | + | * '' |
- | * Open a terminal and right-click in it to discover/ | + | * There is also a '' |
- | * More options with CTRL+right-click | + | * Open a terminal and right-click in it to check the available |
+ | * You can access even more options with CTRL+right-click | ||
* You can cycle between the open WSLtty terminals with CTRL+Tab and Shift+CTRL+Tab | * You can cycle between the open WSLtty terminals with CTRL+Tab and Shift+CTRL+Tab | ||
* [[https:// | * [[https:// | ||
Line 107: | Line 118: | ||
=== The new Windows Terminal === | === The new Windows Terminal === | ||
- | Microsoft is working on a powerful replacement of the old '' | + | Microsoft is working on a powerful replacement of the old '' |
- | You can install it from the Microsoft Store: search | + | Note: the //Windows Terminal// looks really promising, but will be nice when there is a GUI for editing the options |
- | [[https://github.com/ | + | * [[https://aka.ms/terminal|Getting the Windows |
+ | * [[https:// | ||
=== Terminals started from Linux === | === Terminals started from Linux === | ||
Line 293: | Line 305: | ||
==== Installing an X server ==== | ==== Installing an X server ==== | ||
- | <WRAP center round tip 60%> | + | Read the [[other:x_conf|Installing and configuring |
- | The //X server// will allow you to display graphical windows (i.e. //X windows//) from remote servers or from your local WSL+Ubuntu | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | <WRAP center round important 60%> | + | |
- | After the X server is installed and running, some graphical applications and images (or the text displayed by those applications) may appear blurry. This is due to some servers or some Linux applications not handling high resolution (//HiDPI//) screens correctly | + | |
- | + | ||
- | X410 has several options for this (see [[https:// | + | |
- | </ | + | |
- | + | ||
- | === Installing | + | |
- | + | ||
- | <note tip> | + | |
- | + | ||
- | Type: <wrap em> | + | |
- | + | ||
- | Download the installer from [[https:// | + | |
- | + | ||
- | == VcXrsv Configuration == | + | |
- | + | ||
- | You need to configure VcXrsv to work in //multiple windows// mode. The following steps will show you how to create a shortcut on your desktop to start VcXrsv in this appropriate mode | + | |
- | + | ||
- | * Start // | + | |
- | * Check '' | + | |
- | * Check '' | + | |
- | * Keep the default '' | + | |
- | * Click on '' | + | |
- | * Click on the new '' | + | |
- | * Note: you can right-click on the '' | + | |
- | * Note: if you notice later that the content of some displayed //X windows// appear **blurry**, see if you can [[other: | + | |
- | * You are now **ready**, if you only need VcXrsv to display graphical windows from remote servers | + | |
- | + | ||
- | * The following steps allow you to test the X server in a **local** WSL+Ubuntu terminal. **Do not set the DISPLAY variable yourself when you are connected to a remote server with '' | + | |
- | * Open a **local** terminal (in WSL+Ubuntu) | + | |
- | * Type '' | + | |
- | * Type '' | + | |
- | + | ||
- | + | ||
- | === Installing x410 === | + | |
- | + | ||
- | Type: <wrap em> | + | |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | **Starting, configuring and exiting X410**: you can start X410 by clicking on it in the Windows Start Menu, or choose to [[https:// | + | |
- | * Note: nothing actually happens when you start X410, as it is just waiting to display graphics! You will just get a new **X** icon in the //hidden// icons of the taskbar. | + | |
- | * You can configure (and exit) X410 by right clicking on its **X** icon | + | |
- | + | ||
- | === Installing MobaXterm === | + | |
- | + | ||
- | Type: <wrap em> | + | |
- | + | ||
- | Available at [[https:// | + | |
==== Configuration (in your local Linux account) ==== | ==== Configuration (in your local Linux account) ==== | ||
Line 392: | Line 351: | ||
===== Updating WSL and ubuntu ===== | ===== Updating WSL and ubuntu ===== | ||
- | <note tip>You don't have to worry about this if you have just installed WSL+Ubuntu!</ | + | <note tip>You don't have to worry about the //Upgrade// section |
==== WSL ==== | ==== WSL ==== | ||
- | WSL is automatically updated | + | **Nothing to do!** WSL is automatically updated, provided you have **enabled** the [[other: |
[[https:// | [[https:// | ||
Line 423: | Line 382: | ||
578 / | 578 / | ||
+ | ==== Upgrading ubuntu ==== | ||
+ | <WRAP center round tip 60%> | ||
+ | You can skip this section if you have just installed ubuntu, since you are already running the latest stable release available | ||
+ | </ | ||
+ | |||
+ | |||
+ | The **updates** are for maintaining the same version of ubuntu (e.g. you go from version '' | ||
+ | |||
+ | We use the **LTS versions** (//Long Time Support//) to ensure even more stability, which means that we will get updates of a given major release for quite some time after the next major release is available, so it is not mandatory to updgrade ubuntu if you are still receiving updates for the release you use | ||
+ | |||
+ | There should not be any risk, but it may be a good idea to [[other: | ||
+ | |||
+ | Use '' | ||
+ | |||
+ | * before the Linux upgrade: | ||
+ | * [[other: | ||
+ | * Check how much space is left on '' | ||
+ | * make sure you have a network connection | ||
+ | * read the official WSL [[https:// | ||
+ | |||
+ | * Launch the upgrade with the '' | ||
+ | * if you get a //There is no development version of an LTS available// message, use '' | ||
+ | * if you get a //Please install all available updates for your release before upgrading// message, use '' | ||
+ | * if you get '' | ||
+ | * < | ||
+ | sleep: cannot read realtime clock: Invalid argument | ||
+ | # mv /bin/sleep / | ||
+ | # ls -l / | ||
+ | -rwxr-xr-x 1 root root 35000 Jan 18 2018 / | ||
+ | # touch /bin/sleep | ||
+ | # chmod +x /bin/sleep | ||
+ | # sleep 1 | ||
+ | #</ | ||
+ | * Note: you may have to use the //empty sleep command trick// again, if the sleep command itself is updated and breaks the upgrading process again. Do not forget to restore the original sleep command after the upgrade!!\\ < | ||
+ | Restarting services possibly affected by the upgrade: | ||
+ | cron: stopping...sleep: | ||
+ | dpkg: error processing package libpam0g: | ||
+ | | ||
+ | E: Sub-process / | ||
+ | # ls -l /bin/sleep | ||
+ | -rwxr-xr-x 1 root root 39256 Sep 5 2019 /bin/sleep | ||
+ | # mv /bin/sleep / | ||
+ | # touch /bin/sleep | ||
+ | # chmod +x /bin/sleep | ||
+ | # </ | ||
+ | * see also [[https:// | ||
+ | * Do not forget to restore the correct '' | ||
+ | * < | ||
+ | -rwxr-xr-x 1 root root 0 Aug 23 23:57 /bin/sleep | ||
+ | -rwxr-xr-x 1 root root 35000 Jan 18 2018 / | ||
+ | -rwxr-xr-x 1 root root 39256 Sep 5 2019 / | ||
+ | # cp -p / | ||
+ | # ls -l /bin/sleep* | ||
+ | -rwxr-xr-x 1 root root 39256 Sep 5 2019 /bin/sleep | ||
+ | -rwxr-xr-x 1 root root 35000 Jan 18 2018 / | ||
+ | -rwxr-xr-x 1 root root 39256 Sep 5 2019 / | ||
+ | |||
+ | |||
+ | ==== Cleaning up things ==== | ||
+ | |||
+ | * [[https:// | ||
===== Advanced configuration ===== | ===== Advanced configuration ===== | ||
Line 651: | Line 671: | ||
==== Rebooting WSL ==== | ==== Rebooting WSL ==== | ||
- | It is not possible to reboot WSL like a regular Linux computer | + | It is not possible to **stop or reboot WSL** like a regular Linux computer |
* '' | * '' | ||
- | * WSL keeps on running even when all the terminals are closed | + | * WSL keeps on running even when all the Linux terminals are closed |
- | Rebooting | + | Shutting down or rebooting |
- | * to force WSL to recognize new disk drives and make them available as ''/ | + | * force WSL to **recognize new disk drives** and make them available as ''/ |
- | * to force WSL to recognize drives that were still encrypted when the first terminal was started | + | * force WSL to recognize drives that were still encrypted when the first WSL terminal was opened |
- | WSL can be rebooted by using either one of the following | + | WSL can be stopped |
- | * from a //Windows | + | * from a Windows |
- | * from the //Services// tab of the Task manager or the //Services// program (launch '' | + | * Get the name of the installed (and running) Linux: **'' |
- | | + | * Stop //this instance// of Linux (e.g. if it is named //Ubuntu//): **'' |
- | * from a //Powershell// in admin mode (right-click on the Windows //Start// button) | + | * or Stop //all// the currently running Linux distributions: |
- | | + | |
- | Source: google '' | ||
==== Creating a backup of the Linux running in WSL ==== | ==== Creating a backup of the Linux running in WSL ==== | ||
There are several types of WSL related directories that you may want to back up: | There are several types of WSL related directories that you may want to back up: | ||
- | | + | |
+ | | ||
* <code bash>$ cd /home | * <code bash>$ cd /home | ||
- | # $ du -sh < | + | |
$ du -sh $USER | $ du -sh $USER | ||
232K < | 232K < | ||
- | # $ tar cfz / | + | |
+ | # We assume below that there is an existing | ||
+ | # It's a WINDOWS directory C:\Scratch\< | ||
$ tar cfz / | $ tar cfz / | ||
- | </ | + | |
+ | # Check the size of the new (and existing old) backup(s) | ||
+ | $ ls -ltr / | ||
+ | 81K Jan 21 2020 / | ||
+ | 93K Aug 22 2020 / | ||
+ | 95K Feb 24 12:09 / | ||
* <wrap hi> | * <wrap hi> | ||
+ | |||
* <wrap hi>The **full** Linux/ | * <wrap hi>The **full** Linux/ | ||
- | * Open a Windows terminal (preferably a // | + | * Open a **Windows terminal** (preferably a // |
- | * Determine the name of the current Linux installation used in WSL | + | * Determine the name of the current Linux installation used in WSL (and see if it is running, and using //WSL 1// or //WSL 2//) |
* < | * < | ||
- | Distributions du sous-système Windows pour Linux : | + | Distributions du sous-système Windows pour Linux : |
- | Ubuntu (par défaut)</ | + | Ubuntu (par défaut) |
+ | |||
+ | > wsl --list --verbose | ||
+ | NAME STATE | ||
+ | * Ubuntu | ||
* [[other: | * [[other: | ||
- | | + | * < |
- | * You can optionally open a new terminal (this will start again WSL+Ubuntu) to get some information about the created file (size and number of saved files/ | + | NAME STATE |
+ | * Ubuntu | ||
+ | |||
+ | > wsl --shutdown | ||
+ | |||
+ | > wsl --list --verbose | ||
+ | NAME STATE | ||
+ | * Ubuntu | ||
+ | | ||
+ | * < | ||
+ | * You can optionally open a new terminal (this will start again WSL+Ubuntu) to get some information about the created file (size and number of saved files/ | ||
* < | * < | ||
- | $ ls -lh < | + | |
- | 2.6G May 14 16:29 < | + | $ ls -ltrh *ubuntu*tar* |
- | $ tar tvf < | + | 976M Jan 21 2020 < |
- | 105600 | + | 2.8G Aug 22 2020 < |
- | $ gzip < | + | 3.4G Feb 24 14:06 < |
- | $ ls -lh < | + | |
- | 976M May 14 16:29 | + | # Determine the number of files/ |
+ | $ tar tvf < | ||
+ | 112711 | ||
+ | |||
+ | $ gzip *ubuntu*.tar | ||
+ | |||
+ | $ ls -ltrh *ubuntu*tar* | ||
+ | 976M Jan 21 2020 < | ||
+ | 1.2G Aug 22 2020 < | ||
+ | 1.8G Feb 24 14:06 < | ||
</ | </ | ||
Line 722: | Line 773: | ||
* Find how to unregister Ubuntu on the [[https:// | * Find how to unregister Ubuntu on the [[https:// | ||
* and then disable WSL??? | * and then disable WSL??? | ||
+ | |||
+ | ===== Miscellaneous ===== | ||
+ | |||
+ | * Determining from **inside** the running Linux if you are using WSL (or another type of virtual machine)\\ < | ||
+ | wsl</ | ||
+ | |||
===== Other WSL resources and links ===== | ===== Other WSL resources and links ===== | ||
other/win10_wsl_1.txt · Last modified: 2022/08/12 14:25 by jypeter