Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change uid ? #3576

Closed
ish-org opened this issue Sep 28, 2018 · 7 comments
Closed

How to change uid ? #3576

ish-org opened this issue Sep 28, 2018 · 7 comments

Comments

@ish-org
Copy link

ish-org commented Sep 28, 2018

I want to specify uid and gid for user foo because I don't use map for NFS.
I changed the uid/gid as follows, but this makes 0x80040305 error.
(1) add newgrp by vigr and vigr -s
(2) usermod -g newgrp foo
(3) edit gid in /etc/wsl.conf
This seems working good.
(4) change uid for foo by vipw
(5) chown -R foo ~foo
(5) edit uid in /etc/wsl.conf
(6) reboot windows10pro.
This makes 0x80040305 error.

@benhillis
Copy link
Member

@ish-org - Which distribution are you using?

@ish-org
Copy link
Author

ish-org commented Sep 29, 2018

I'm using WLinux version 1.1.15.0 purchased from the windows store.
$ cat /etc/os-release | grep -v _URL
PRETTY_NAME="WLinux"
NAME="WLinux"
ID=debian
$ cat /etc/issue| sed '/^$/D'
Debian GNU/Linux 9 \n \l
$ cat /etc/debian_version
9.5

@ish-org
Copy link
Author

ish-org commented Sep 29, 2018

I found that this thread is for ubuntu, sorry.
Then I installed ubuntu 18.04.1 LTS, but the same error has occurred.
$ cat /etc/os-release | grep -v _URL
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
$ cat /etc/issue| sed '/^$/D'
Ubuntu 18.04.1 LTS \n \l
$ cat /etc/debian_version
buster/sid

Is there any versions/distributions of specifying UID/GID for initial user creation ?

@ish-org
Copy link
Author

ish-org commented Sep 30, 2018

I solved this problem.
Open cmd.exe with administrator privileges and edit computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss{cefb...cb50}\DefaultUid to newuid with regedit.

@ish-org ish-org closed this as completed Sep 30, 2018
@sirredbeard
Copy link
Contributor

Good to know. Thank you, @ish-org.

@silent567
Copy link

silent567 commented Jan 18, 2019

I solved this problem.
Open cmd.exe with administrator privileges and edit computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss{cefb...cb50}\DefaultUid to newuid with regedit.

Hi, @ish-org

I am looking for methods to mount NFS in WSL. Until now, I only found this issue #2869 saying that there was no support for NFS. It seems that you have mounted NFS successfully. Could you please describe the procedures? Or has WSL alreadly supported NFS now?

I am using Ubuntu18.04 on win10 and keeping receiving error: mount.nfs: no such device.

Thank you very much!

@MagicFrogSJTU
Copy link

I solve this problem in wsl2 using the following two steps:

  1. replace uid with newuid in /etc/passwd in wsl
  2. change computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss{cefb...cb50}\DefaultUid to newuid with regedit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants