Table of Contents
1 Install Bash on SUSE on Windows
Install Bash on SUSE on Windows as below.
- Enable Windows Subsystem for Linux and install Bash on Ubuntu on Windows with this way.
- Replace root filesystem to Bash on SUSE on Windows with this way.
Now you can run root’s bash on Windows.
2 Add user
Run bash.exe as root.
C:Usershiroom2AppDataLocallxss>lxrun /setdefaultuser rootC:Usershiroom2AppDataLocallxss>bash
Only adding user cannot run privilege command like zypper. You need to set root password or to use sudo. This article uses sudo.
Install sudo and enable wheel group setting.
# zypper -n in sudo# sed -e ‘s/# (%wheel.*NOPASSWD:.*)/1/g’ -i /etc/sudoers
If you need visudo, install editor.
# zypper -n in nano# EDITOR=nano visudo # vi does not need EDITOR.
Add new user and add user to wheel group.
# useradd hiroom2# passwd hiroom2New password:Retype new password:# gpasswd -a hiroom2 wheel
Terminate bash.exe.
# exit
Run bash.exe as added user.
C:Usershiroom2AppDataLocallxss>lxrun /setdefaultuser hiroom2C:Usershiroom2AppDataLocallxss>bash$ # This is added user bash.
3 Run ssh server
You cannot user systemctl because D-BUS does not work. You need to run sshd command directly.
$ sudo zypper -n in openssh$ sudo /usr/sbin/sshd-gen-keys-start$ sudo /usr/sbin/sshd -D &