You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ Linuxmint on WSL2 (Windows 10 FCU or later) based on [wsldl](https://github.com/
10
10
LinuxmintWSL2 has the following features during the installation stage.
11
11
* Increase virtual disk size from the default 256GB
12
12
* Create a new user and set the user as default
13
-
14
-
LinuxmintWSL2 includes a wsl.conf file which only has section headers. Users can use this to configure the distro to their liking. You can read more about wsl.conf and its configuration settings [here](https://docs.microsoft.com/en-us/windows/wsl/wsl-config).
13
+
* LinuxmintWSL2 Supports systemd natively if you are running wsl v0.67.6 (more details [here](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/)) and above. For earlier versions of wsl, systemd is supported using diddledani's [one-script-wsl2-systemd](https://github.com/diddledani/one-script-wsl2-systemd). This is done automatically during initial setup.
14
+
*LinuxmintWSL2 includes a wsl.conf file which only has section headers. Users can use this to configure the distro to their liking. You can read more about wsl.conf and its configuration settings [here](https://docs.microsoft.com/en-us/windows/wsl/wsl-config).
15
15
16
16
## Requirements
17
17
* For x64 systems: Version 1903 or higher, with Build 18362 or higher.
@@ -219,6 +219,9 @@ sudo apt install docker-ce
219
219
sudo usermod -aG docker $USER
220
220
```
221
221
222
-
Follow [this](https://blog.nillsf.com/index.php/2020/06/29/how-to-automatically-start-the-docker-daemon-on-wsl2/) blog post for further details on how to set it up.
Follow [this](https://blog.nillsf.com/index.php/2020/06/29/how-to-automatically-start-the-docker-daemon-on-wsl2/) blog post for further details on how to set it up. Alternatively, if using systemd, use the commands below to setup and reboot.
echo -e "\033[33;7mDo not interrupt or close the terminal window till script finishes execution!!!\n\033[0m"
27
27
28
28
if [ "$disksize"-le 274877906944 ];then
29
-
echo -e ${grn}"LinuxmintWSL's VHD has a default maximum size of 256GB. Disk space errors which occur if size exceeds 256GB can be fixed by expanding the VHD. Would you like to resize your VHD? More information on this process is available at \033[36mhttps://docs.microsoft.com/en-us/windows/wsl/vhd-size\033[32m."${txtrst}| fold -sw $width
30
-
selectynin"Yes""No";do
31
-
case$ynin
32
-
Yes)
33
-
echo""
34
-
whileread -p ${mgn}"Path to virtual disk (e.g. C:\Users\silesh\wsl\ext4.vhdx) : "${txtrst} -r vhdpath;do
35
-
if [ "x$vhdpath"="x" ];then
36
-
echo -e ${red}"Path cannot be blank."${txtrst}
37
-
echo -en "\033[1A\033[1A\033[2K"
38
-
vhdpath=""
39
-
else
40
-
wsl_path=$(wslpath -a $vhdpath)
41
-
if [ !-f$wsl_path ];then
42
-
echo -e ${red}"Disk does not exist. "${txtrst}
43
-
echo -en "\033[1A\033[1A\033[2K"
44
-
vhdpath=""
45
-
else
46
-
echo"select vdisk file=\"$vhdpath\""| sudo tee -a ~/vhdresize.txt >/dev/null 2>&1
47
-
break
48
-
fi
49
-
fi
50
-
done
51
-
whileread -p ${mgn}"Size of virtual disk in MegaBytes(e.g. 512000 for 512GB) : "${txtrst} vhdsize;do
52
-
if [[ $vhdsize=~ ^-?[0-9]+$ ]];then
53
-
if [ "$vhdsize"-le 256000 ];then
54
-
echo -e ${red}"Disk size should be greater than 256000 MegaBytes."${txtrst}
55
-
echo -en "\033[1A\033[1A\033[2K"
56
-
vhdsize=0
57
-
else
58
-
echo -en "\033[1B\033[1A\033[2K"
59
-
echo"expand vdisk maximum=$vhdsize"| sudo tee -a ~/vhdresize.txt >/dev/null 2>&1
60
-
echo""
61
-
printf"%s""$(<~/vhdresize.txt)"
62
-
echo""
63
-
echo -e ${grn}"\nReview the information displayed above and confirm to proceed."${txtrst}
64
-
echo -e ${red}"Edit only your input if you want to make changes!!!"${txtrst}
65
-
selectynin"Proceed""Edit";do
66
-
case$ynin
67
-
Proceed)
68
-
break
69
-
;;
70
-
Edit)
71
-
"${EDITOR:-nano}"~/vhdresize.txt
72
-
break
73
-
;;
74
-
esac
75
-
done
76
-
echo"@echo off"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
77
-
echo"wsl --shutdown"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
78
-
echo"diskpart /s C:\Users\Public\vhdresize.txt"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
79
-
if env | grep "WT_SESSION">/dev/null 2>&1;then
80
-
echo"wt.exe -w 0 nt wsl.exe -d $WSL_DISTRO_NAME"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
81
-
else
82
-
echo"cmd /c start \"$WSL_DISTRO_NAME\" wsl.exe --cd ~ -d $WSL_DISTRO_NAME"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
echo -e ${red}"Disk size cannot be blank and has to be numeric. "${txtrst}
90
-
echo -en "\033[1A\033[1A\033[2K"
91
-
fi
92
-
done
29
+
echo -e ${grn}"LinuxmintWSL's VHD has a default maximum size of 256GB. Disk space errors which occur if size exceeds 256GB can be fixed by expanding the VHD. Would you like to resize your VHD? More information on this process is available at \033[36mhttps://docs.microsoft.com/en-us/windows/wsl/vhd-size\033[32m."${txtrst}| fold -sw $width
30
+
selectynin"Yes""No";do
31
+
case$ynin
32
+
Yes)
33
+
echo""
34
+
whileread -p ${mgn}"Path to virtual disk (e.g. C:\Users\silesh\wsl\ext4.vhdx) : "${txtrst} -r vhdpath;do
35
+
if [ "x$vhdpath"="x" ];then
36
+
echo -e ${red}"Path cannot be blank."${txtrst}
37
+
echo -en "\033[1A\033[1A\033[2K"
38
+
vhdpath=""
39
+
else
40
+
wsl_path=$(wslpath -a $vhdpath)
41
+
if [ !-f$wsl_path ];then
42
+
echo -e ${red}"Disk does not exist. "${txtrst}
43
+
echo -en "\033[1A\033[1A\033[2K"
44
+
vhdpath=""
45
+
else
46
+
echo"select vdisk file=\"$vhdpath\""| sudo tee -a ~/vhdresize.txt >/dev/null 2>&1
47
+
break
48
+
fi
49
+
fi
50
+
done
51
+
whileread -p ${mgn}"Size of virtual disk in MegaBytes(e.g. 512000 for 512GB) : "${txtrst} vhdsize;do
52
+
if [[ $vhdsize=~ ^-?[0-9]+$ ]];then
53
+
if [ "$vhdsize"-le 256000 ];then
54
+
echo -e ${red}"Disk size should be greater than 256000 MegaBytes."${txtrst}
55
+
echo -en "\033[1A\033[1A\033[2K"
56
+
vhdsize=0
57
+
else
58
+
echo -en "\033[1B\033[1A\033[2K"
59
+
echo"expand vdisk maximum=$vhdsize"| sudo tee -a ~/vhdresize.txt >/dev/null 2>&1
60
+
echo""
61
+
printf"%s""$(<~/vhdresize.txt)"
62
+
echo""
63
+
echo -e ${grn}"\nReview the information displayed above and confirm to proceed."${txtrst}
64
+
echo -e ${red}"Edit only your input if you want to make changes!!!"${txtrst}
65
+
selectynin"Proceed""Edit";do
66
+
case$ynin
67
+
Proceed)
68
+
break
69
+
;;
70
+
Edit)
71
+
"${EDITOR:-nano}"~/vhdresize.txt
72
+
break
73
+
;;
74
+
esac
75
+
done
76
+
echo"@echo off"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
77
+
echo"wsl --shutdown"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
78
+
echo"diskpart /s C:\Users\Public\vhdresize.txt"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
79
+
if env | grep "WT_SESSION">/dev/null 2>&1;then
80
+
echo"wt.exe -w 0 nt wsl.exe -d $WSL_DISTRO_NAME"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
81
+
else
82
+
echo"cmd /c start \"$WSL_DISTRO_NAME\" wsl.exe --cd ~ -d $WSL_DISTRO_NAME"| sudo tee -a ~/shutdown.cmd >/dev/null 2>&1
0 commit comments