Try the evaluation version of Bash on Ubuntu on Windows

Hello.
I'm Mandai, in charge of Wild on the development team.

Personally, I think the biggest topic this summer is Bash support in Windows 10, but what do you think?

Since it was announced at Build 2016, there hasn't been much information, so I was wondering what to expect. However, I found out that you can try out the currently developing Bash by installing the preview version of Windows 10, so I decided to give it a try and would like to report on it


 

Set up the environment where the preview version will be installed

In a typical Windows 10 environment, you'd have to wait until the official version was installed, so
"Experience Bash on Ubuntu on Windows early with the LAVIE Hybrid ZERO | Digital Lifestyle Department" to join the Windows Insider Preview program. I
followed the instructions in the link and completely trusted the detailed settings, which worked perfectly.

It said that it would take a few days for the latest developer preview to be released, but
I was surprised to receive an update notification to the latest developer preview the very next day.

After rebooting a few times, the installation was completed successfully

insider_preview_version

 

I'm having trouble with "Please enter a UNIX user name"

Now it's time to start bash, so I press the Windows key and type "bash" and the words "Bash on Ubuntu on Windows" appear!
Once started, a console screen that is no different from a command prompt will appear.

However, the Japanese environment was incomplete, and the characters were garbled and I couldn't understand what was written, so I had trouble with the notation ``Please enter a UNIX user name.''

bash_01

In conclusion

If you type root you can log in without a password!

That's it. Well, it's just a preview version,
so let's not worry about the details.

 

The Windows C drive is mounted under /mnt/c

The directory structure is a bit weird.
If /mnt/c is the C drive, then where on earth is /? That's a valid question, but it's a preview version after all.

Although I am root, I act like a superuser and cannot access the Documents and Settings area (Permission denied)

 

When I run ls on a file with a Japanese file name, it gets cut off halfway through

In general, it seems that multi-byte character support is not implemented.
The df command does not work properly either, so I cannot check. I
guess that's unavoidable since the kernel is not Linux.
It would be very useful if we could see more details about this.

 

When I type ps, there are almost no processes running

Don't expect Task Manager-like functionality from the ps command.
The Bash environment and the Windows environment seem to be managed completely separately.

ps_aux

 

How far can you actually go?

So, I installed some software to see how useful it is at this stage

 

ssh

The remote host is accessible, and key-based authentication works without any issues

 

sed

It's installed by default and works fine

 

awk

It's installed by default and works fine

 

vi

It's installed by default and works fine

 

top

It is installed by default and works, but no information other than the PID is available

bash_2

 

grep

It's installed by default and works fine

 

wget

It's installed by default and works fine

 

curl

It is installed by default and works without any problems.
Please note that communications other than HTTP, such as FTP, have not been tested.

 

ping

Installed by default.
The message "ping icmp open socket: Socket type not supported" appears and ping cannot be sent.

ping

 

netstat

It's installed by default and works fine.
However, it doesn't display anything, probably because socket communication is not possible.

 

Shell script

Bash and dash are provided.
By the way, since this is a port from Ubuntu, /bin/sh is a symbolic link to /bin/dash (this is the same as Ubuntu).

 

Apache

I was able to install it but it didn't work. I
got an error saying that the socket could not be created properly and it wouldn't start.

apache2_start

 

PHP

apt-get install php5


 It can be installed with
php5-curl etc. can also be installed from apt-get, so it seems that command line tools will work without any problems.

 

Sending an email from the console

If the mail command is not installed, install it using the following command

apt-get install mailutils

 
However, the mail command doesn't work

 

mysql

It can be installed with the following command

apt-get install mysql-server

 
It moves! (Normally too)

However, the following error is displayed:

/etc/init.d/mysql start df: Warning: cannot read table of mounted file systems: No such file or directory /lib/lsb/init-functions.d/50-ubuntu-logging: line 5: 46 Aborted (core dumped) plymouth --ping > /dev/null 2>&1 * Starting MySQL database server mysqld /lib/lsb/init-functions.d/50-ubuntu-logging: line 5: 485 Aborted (core dumped) plymouth --ping > /dev/null 2>&1 [ OK ] * Checking for tables which need an upgrade, are corrupt or were not closed cleanly.

mysql_start

 

summary

I was surprised to see curl and wget working normally, but considering I can install software with apt-get, I assumed TCP/IP communication was possible.
However, I was surprised that the ping command didn't work.
It revealed that I don't understand how the commands I use every day work.

I was shocked to see that MySQL was working normally.
However, an error occurred when starting the MySQL server, so perfect operation may not be possible.
The data remained even after stopping and starting, and even after turning off the PC, so it seems to be working.

At this rate, it seems like tools that link PHP and MySQL from the console should work.
However, the socket file written in my.cnf cannot be created, and looking at netstat there is no sign that port 3306 is being used.
Error logs are popping up all the time, so I can guess that the operation is quite unstable.

 

What you can do now

Checking simple batch processing? No, no, I don't have an environment where I can test it yet. Perhaps the only thing I can do is use SSH without needing cygwin or git bash.
From an MSP perspective, using bash on Ubuntu on Windows would allow me to perform monitoring checks in the same way as on Linux, but since I haven't even done that yet, it's difficult to evaluate, but I think it's a big step forward.
If it works well, it will likely completely change the way I monitor Windows.

 
That's it.

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
579
X facebook Hatena Bookmark pocket

The person who wrote this article

About the author

Yoichi Bandai

My main job is developing web APIs for social games, but I'm also fortunate to be able to do a lot of other work, including marketing.
Furthermore, my portrait rights in Beyond are treated as CC0 by him.