Windows Subsystem for Linux(Ubuntu)

Windows10 Pro(1803)、ディストリビューションはUbuntu(18.0.4)を使用しています 。最初に使い始めるまでの流れを忘れてしまうので備忘録です。


Windowsのアプリと機能 > プログラムと機能 > Windowsの機能の有効化または無効化を選択し、Windows Subsystem for Linuxにチェックを付ける

※Windows Storeからいきなりインストールできると思って、勢い余って進めるとエラーになります。error: 0x8007019e


Windows StoreからUbuntuを検索し、インストールをクリック



Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: hogetaro
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.



sudo apt update


sudo apt upgrade



sudo apt install [コマンド]でインストールする

hogetaro@DESKTOP-PC:~$ whois

Command 'whois' not found, but can be installed with:

sudo apt install whois

hogetaro@DESKTOP-PC:~$ sudo apt install whois
[sudo] password for hogetaro:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 43.7 kB of archives.
After this operation, 262 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 whois amd64 5.3.0 [43.7 kB]
Fetched 43.7 kB in 1s (42.5 kB/s)
Selecting previously unselected package whois.
(Reading database ... 28491 files and directories currently installed.)
Preparing to unpack .../archives/whois_5.3.0_amd64.deb ...
Unpacking whois (5.3.0) ...
Setting up whois (5.3.0) ...
Processing triggers for man-db (2.8.3-2) ...
hogetaro@DESKTOP-PC:~$ which whois



hogetaro@DESKTOP-PC:/mnt/c$ cd /mnt/c/
hogetaro@DESKTOP-PC:/mnt/c$ ls
ls: cannot read symbolic link 'Documents and Settings': Permission denied
ls: cannot access 'hiberfil.sys': Permission denied
ls: cannot access 'pagefile.sys': Permission denied
ls: cannot access 'swapfile.sys': Permission denied
'$GetCurrent'                      Intel                  SQLServer2017Media           msdia80.dll
'$Recycle.Bin'                     MSOCache               SVN                          pagefile.sys
'$WINRE_BACKUP_PARTITION.MARKER'   OneDriveTemp          'System Volume Information'   sts-bundle
 ADE                               PerfLogs               TEMP_PARALLELS_TOOLS         swapfile.sys
 AppleBcInstaller.log             'Program Files'         Users                        temp
 BOOTNXT                          'Program Files (x86)'   Windows                      workspace-sts
 Config.Msi                        ProgramData            Windows10Upgrade
'Documents and Settings'           RHDSetup.log           bootmgr
 GIT                               Recovery               hiberfil.sys