


Windows 10 Insider Preview Build 14316に更新できたのでbashを使ってみたいと思います。
[設定]-[更新とセキュリティ]-[開発者向け]から開発者モードに変更します。
コントロールパネルから[プログラム]-[プログラムと機能]からWindowsの機能の有効化または無効化を実行します。
Windowsの機能で[Windows Subsystem for Linux(beta)]にチェックを入れて[OK]をクリックします。
Windows Updateから必要なプログラムがダウンロードされてインストールが始まります。
再起動後にコマンドプロンプトを開いてbashと入力するとメッセージが表示されます。
ベータ版でWindows上にUbuntuをインストールするけど、これはCanonical社が提供するもので下記のライセンスを守って利用してねってところでしょうか。
同意するなら[y]を入力するとWindowsストアからUbuntuのインストールが開始されます。
C:\Users\RootLinks>bash
— Beta feature —
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
https://aka.ms/uowtermsType “y” to continue: y
Downloading from the Windows Store… 100%
Extracting filesystem, this will take a few minutes…
??????????????????????????…
一部文字化けしてますね。これで環境が整いました。
少し操作してみました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
root@localhost:/mnt/c/Users/RootLinks# ll ls: cannot access Application Data: Input/output error ls: cannot access Cookies: Input/output error ls: cannot access Local Settings: Input/output error ls: cannot access My Documents: Input/output error ls: cannot access NetHood: Input/output error ls: cannot access PrintHood: Input/output error ls: cannot access Recent: Input/output error ls: cannot access SendTo: Input/output error ls: cannot access Templates: Input/output error ls: cannot access スタート メニュー: Input/output error total 2552 drwxrwxrwx 2 root root 0 Apr 7 01:01 ./ drwxrwxrwx 2 root root 0 Apr 7 00:58 ../ d????????? ? ? ? ? ? スタート メニュー/ drwxrwxrwx 2 root root 0 Apr 7 00:58 AppData/ (snip) |
JUNCTIONはアクセス権が取得できないようです。また管理者権限で実行すればcannot accessは無くなると思います。
root(/)に移動してみます。一通りそれらしいものがありました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
root@localhost:/mnt/c/Users/RootLinks# cd / root@localhost:/# ll total 125 drwxrwxr-x 2 root root 0 Apr 7 01:22 ./ drwxrwxr-x 2 root root 0 Apr 7 01:22 ../ drwxr-xr-x 2 root root 0 Apr 7 04:58 acct/ drwxr-xr-x 2 root root 0 Mar 23 20:45 bin/ drwxr-xr-x 2 root root 0 Mar 23 20:54 boot/ drwxrwx--- 2 1000 2001 0 Jan 1 1970 cache/ drwxrwx--x 2 1000 1000 0 Jan 1 1970 data/ drwxr-xr-x 2 root root 0 Apr 7 04:58 dev/ drwxr-xr-x 2 root root 0 Mar 23 20:54 etc/ drwxr-xr-x 2 root root 0 Jan 1 1970 home/ -rwxr-x--- 1 root root 22856 Jan 1 1970 init* drwxr-xr-x 2 root root 0 Mar 23 20:54 lib/ drwxr-xr-x 2 root root 0 Mar 23 20:42 lib64/ drwx------ 2 root root 0 Mar 23 20:46 lost+found/ drwxr-xr-x 2 root root 0 Mar 23 20:41 media/ drwxrwxr-x 2 root 1000 0 Apr 7 01:22 mnt/ drwxr-xr-x 2 root root 0 Mar 23 20:41 opt/ dr-xr-xr-x 1 root root 0 Apr 7 01:22 proc/ drwx------ 2 root root 0 Apr 7 01:31 root/ drwxr-xr-x 2 root root 0 Apr 7 01:22 run/ drwxr-xr-x 2 root root 0 Mar 23 20:45 sbin/ drwxr-xr-x 2 root root 0 Mar 23 20:41 srv/ dr-xr-xr-x 1 root root 0 Apr 7 01:22 sys/ drwxrwxrwt 2 root root 0 Mar 23 20:54 tmp/ drwxr-xr-x 2 root root 0 Mar 23 20:41 usr/ drwxr-xr-x 2 root root 0 Mar 23 20:45 var/ |
どんなコマンドがあるのかな。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
root@localhost:/# ls /sbin/ acpi_available fsck.ext2 iptables-apply mount.fuse sgdisk agetty fsck.ext3 iptables-restore mount.lowntfs-3g shadowconfig apm_available fsck.ext4 iptables-save mount.ntfs shutdown apparmor_parser fsck.ext4dev iptunnel mount.ntfs-3g slattach badblocks fsck.fat isosize mount.vmhgfs start blkid fsck.minix kbdrate nameif startpar blockdev fsck.msdos killall5 ntfsclone startpar-upstart-inject bridge fsck.nfs ldconfig ntfscp start-stop-daemon capsh fsck.vfat ldconfig.real ntfslabel status cfdisk fsfreeze logsave ntfsresize stop cgdisk fstab-decode losetup ntfsundelete sulogin cryptdisks_start fstrim lsmod on_ac_power swaplabel cryptdisks_stop fstrim-all MAKEDEV pam_tally swapoff cryptsetup gdisk mii-tool pam_tally2 swapon cryptsetup-reencrypt getcap mkdosfs parted switch_root ctrlaltdel getpcaps mke2fs partprobe sysctl debugfs getty mkfs pivot_root tc depmod halt mkfs.bfs plipconfig telinit dhclient hdparm mkfs.cramfs plymouthd tune2fs dhclient-script hwclock mkfs.ext2 poweroff udevadm dmsetup ifconfig mkfs.ext3 rarp udevd dosfsck ifdown mkfs.ext4 raw unix_chkpwd dosfslabel ifquery mkfs.ext4dev reboot unix_update dumpe2fs ifup mkfs.fat reload upstart-dbus-bridge e2fsck init mkfs.minix resize2fs upstart-event-bridge e2image initctl mkfs.msdos resolvconf upstart-file-bridge e2label insmod mkfs.ntfs restart upstart-local-bridge e2undo installkernel mkfs.vfat rmmod upstart-socket-bridge ethtool ip mkhomedir_helper route upstart-udev-bridge fatlabel ip6tables mkntfs rtacct ureadahead fdisk ip6tables-apply mkswap rtmon veritysetup findfs ip6tables-restore mntctl runlevel vmware-hgfsmounter fixparts ip6tables-save modinfo setcap wipefs fsck ipmaddr modprobe setvtrgb xtables-multi fsck.cramfs iptables mountall sfdisk root@localhost:/# ls /bin/ bash dnsdomainname lowntfs-3g ntfsls stty bunzip2 domainname ls ntfsmftalloc su busybox dumpkeys lsblk ntfsmove sync bzcat echo lsmod ntfstruncate tailf bzcmp ed mkdir ntfswipe tar bzdiff egrep mknod open tempfile bzegrep false mktemp openvt touch bzexe fgconsole more pidof true bzfgrep fgrep mount ping udevadm bzgrep findmnt mountpoint ping6 ulockmgr_server bzip2 fuser mt plymouth umount bzip2recover fusermount mt-gnu plymouth-upstart-bridge uname bzless grep mv ps uncompress bzmore gunzip nano pwd unicode_start cat gzexe nc rbash vdir chgrp gzip nc.openbsd readlink which chmod hostname netcat red whiptail chown ip netstat rm ypdomainname chvt kbd_mode nisdomainname rmdir zcat cp kill ntfs-3g rnano zcmp cpio kmod ntfs-3g.probe running-in-container zdiff dash less ntfs-3g.secaudit run-parts zegrep date lessecho ntfs-3g.usermap sed zfgrep dbus-cleanup-sockets lessfile ntfscat setfont zforce dbus-daemon lesskey ntfsck setupcon zgrep dbus-uuidgen lesspipe ntfscluster sh zless dd ln ntfscmp sh.distrib zmore df loadkeys ntfsdump_logfile sleep znew dir login ntfsfix ss dmesg loginctl ntfsinfo static-sh |
dfはエラーになります。
1 2 |
root@localhost:/# df df: cannot read table of mounted file systems: No such file or directory |
viでファイルを作成したら改行コードはLFでした。
1 2 3 4 5 |
root@localhost:/mnt/c/Users/RootLinks# file test test: ASCII text root@localhost:/mnt/c/Users/RootLinks# od -a test 0000000 t e s t nl t e s t nl t e s t nl nl 0000020 |
sshで接続してみます。
1 2 3 4 |
root@localhost:~# ssh matsuoka@192.168.1.100 The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established. ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx. Warning: Permanently added '192.168.1.100' (ECDSA) to the list of known hosts. |
接続できそうでしたが、いつまで待ってもログインできませんでした。
Ubuntuは%USERPROFILE%\AppData\Local\lxss, %USERPROFILE%\AppData\Local\lxss\rootfsにそれぞれインストールされていました。
まだベータ版でこれからどこまでインプリメントされるのか楽しみですが、実際使う?って問われるといまのところ使わないかな(^^;