(using WSL ubuntu app) system has not been booted

2019-06-10 11:42发布

问题:

I'm a very first user of Ubuntu. I failed to install Ubuntu in wmware ,so I installed Ubuntu application in Microsoft app store and everything was quite all right. But when I insert shutdown or halt command to power off my ubuntu I kept getting 'system has not been booted with system as init system (PID 1). Can't operate' error message.

I tried to using docker following with this link (https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/) but I failed after going to Number 2 process many times. I'm not sure my failure is because of installing docker toll box instead of normal one. (my computer is just windows 10. not a windows pro)

I think I have to try other thing. If you don't mind me asking, how can I slove this problem?

(and one more. If I just click 'X' button at the top of right side, is it different with shutting down Ubuntu using 'halt' or 'shutdown' command?

Thank you

回答1:

First of all, Ubuntu installed via MS Store is using WSL (Windows Subsystem for Linux) Technology. It simply means there is no virtualization, Windows and Linux kernels are living side by side (the Linux kernel is not fully implemented yet).

So if you are trying to "shut down your Ubuntu", you would turn off the whole computer just like the Windows does. But in this case, WSL doesn't apparently have rights to do that.

In other words, you can look at your Ubuntu bash window just like any other terminal, like e.g. CMD or PowerShell.

When you start a program in the WSL (Ubuntu), you can see it also in Windows Task Manager - that's just a proof, that there is no virtualization.

Regarding docker: If I'm not mistaken Windows 10 Home doesn't provide Hyper-V virtualization. It means you'll have to use a different one e.g. by using VirtualBox. In order to make it work, I can recommend you to follow this tutorial and especially for VirtualBox please check this answer here

Hope it helps :)