27
14
I'd like to change the home directory of the user that I initially setup on Windows Subsystem for Linux. I found this command
sudo usermod -d /mnt/c/Users/Alex alex
Which should allow this, however I am getting this error
usermod: user alex is currently used by process 2
Presumably because I am logged in as that user. I've tried going to root by doing sudo su -
and then running the command again but I get the same issue. I tried a command I found on Google to log out the user alex
from root but that also kicked me out of bash entirely.
Any thoughts?
Can you not logout of that account, login as another account, and then run the commands to see what result you get? – Pimp Juice IT – 2016-10-11T20:53:06.517
Logging out of that account closes Linux bash and gets you back to Windows prompt. Logging back in just puts you by default in that user. And switching to root through
sudo su -
I still get the process error – Xeon06 – 2016-10-11T21:25:58.010I see, I assume you cannot log into the Windows as another account while logged out of that one, and then run the bash command then from that account in bash for the other account? I've not setup bash within Windows yet so just thinking of potential simple solutions even though having to do that would be sort of inconvenient but if it's just a one-time deal then done, maybe it'd work. Quick thoughts only though. – Pimp Juice IT – 2016-10-11T23:25:01.503
Unfortunately the bash environment is tied to the current user Windows, stored in %appdata%. So another user will get their own bash environment – Xeon06 – 2016-10-12T14:43:43.473
You can change the default user name by executing in Windows (not bash)
lxrun /setdefaultuser myusername
. – harrymc – 2016-10-12T20:23:06.177@harrymc I'm trying to change the home directory and not the username, but perhaps there's another such lxrun command for that? – Xeon06 – 2016-10-13T14:31:51.530