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

Integrating with Windows Home #289

nfarrar opened this Issue Apr 12, 2015 · 13 comments


None yet

nfarrar commented Apr 12, 2015

Is there a recommended way for integrating babun with my HOME directory on windows? On cygwin (before trying out babun) I would set my home directoy to my windows home directory using:

mkpasswd -l -p "$(cygpath -H)" > /etc/passwd

Which was nice - it eliminated having multiple "homes" and file confusion.

As a work around (with babun), I'm currently just symlinking folders into babun's home:

ln -s /cygdrive/c/Users/nfarrar/Documents ~/Documents
ln -s /cygdrive/c/Users/nfarrar/Music ~/Music
ln -s /cygdrive/c/Users/nfarrar/Pictures ~/Pictures
ln -s /cygdrive/c/Users/nfarrar/Videos ~/Videos

This works, but I'd prefer to avoid having 'multiple homes' to keep things more straight forward.

@nfarrar nfarrar changed the title from Integrating with Home Folder to Integrating with Windows Home Apr 12, 2015


This comment has been minimized.


kubamarchwicki commented Apr 12, 2015

According to some tweets, setting HOME env variable upfront does the magic. See the twitter conversation:

- close babun
- set HOME env
- start babun (don't be shocked by the theme)
- execute babun install
- restart babun

This comment has been minimized.

nfarrar commented Apr 14, 2015

Thank you @kubamarchwicki. Worked perfectly. Easy as pie.

  1. Add HOME to windows environment variables:
    • Windows Key
    • Type (in search): env
    • Select Edit environment variables for your account
    • . Select New
      • Name: HOME
      • Value: C:\Users\nfarrar
  2. Launch babun
  3. Type: babun install
  4. Restart babun

Appears that babun itself is still installed to $HOME/.babun but is now using C:\Users\nfarrar as $HOME (desired behavior) and as an added bonus, babun install moved my user files/configuration from C:\Users\nfarrar\.babun\ to C:\Users\nfarrar. Very awesome. Thank you!


This comment has been minimized.

nfarrar commented Apr 20, 2015

Thought I'd update this thread in case anyone else reads this. The instructions above are just a bit incomplete - if you change your HOME using the environment variable, you're original $HOME remains intact (it isn't actually moved).

So, when I discovered my old $HOME still existed, I moved it - and suddenly ssh stopped working. This is because your home directory is also configured in /etc/passwd - and several applications (including ssh) will use this value, rather than the value of $HOME (so even though I'm starting up in C:\Users\nfarrar, ssh was still using the key from /home/nfarrar/.ssh.

To resolve this, update the path to your home in /etc/passwd as well with the command mkpasswd -l -p $(cygpath -H) > /etc/passwd. Now it appears I'm actually fixed. :)

@nfarrar nfarrar closed this Apr 20, 2015


This comment has been minimized.

toddpi314 commented Jun 5, 2015

+1 - Thanks @nfarrar


This comment has been minimized.

bobkocisko commented Jul 20, 2015

One thing I would like to add: Following the instructions from @nfarrar (thanks!) I lost zsh after running mkpasswd; it defaulted to bash. So rather than running mkpasswd, I recommend editing your /etc/passwd file and editing the one line for your user name, to replace the home directory with the new one you want. I found that then I didn't lose zsh.


This comment has been minimized.

webcaetano commented Nov 12, 2015

@nfarrar thanks


This comment has been minimized.

Velvorn commented Jan 27, 2016

Thanks @nfarrar and @bobkocisko!


This comment has been minimized.

AndySw commented Feb 12, 2016

Hi guys - I would highly recommend putting the same warning that you get when installing Babun regarding the HOME variable not being fully supported on the website. This process is not without risk and I ended up reinstalling Babun and picking through my Windows home directory deleting left over files - not fun!



This comment has been minimized.

saikatm commented Aug 8, 2016

@nfarrar i was having problem after setting environment path to HOME . after some just landed here and tried this commend mkpasswd -l -p "$(cygpath -H)" > /etc/passwd that just helped me, thanks!


This comment has been minimized.

jckegelman commented Oct 7, 2016

Hi guys. Thanks @nfarrar for the helpful instructions. I experienced some file permission problems even after issuing the suggested mkpasswd command and came upon this document that recommends against using /etc/passwd and /etc/group in favor of /etc/nsswitch.conf starting with Cygwin 1.7.34.

To resolve the issues I was having, I backed up my existing /etc/passwd and /etc/group files, just in case

mv /etc/passwd /etc/passwd.old
mv /etc/group /etc/group.old

Then I created a blank /etc/passwd file (required to pass babun check - see /usr/local/etc/babun/source/babun-core/tools/

touch /etc/passwd

To keep zsh as the shell on startup, add the following line to /etc/nsswitch.conf (default is bash)

db_shell: /bin/zsh

After that, everything seems to be working. Thanks!


This comment has been minimized.

batandwa commented Nov 4, 2016

Thanks guys your suggestions worked. @kubamarchwicki's suggestion to change the HOME variable helped a bit but lead to #683.
I then tried the mkpasswd approach mentioned by @nfarrar.
All seems fine now.


This comment has been minimized.

hedgehog commented Dec 20, 2016

I think mapping ~ to $USERPROFILE is most easily done as follows:

{ ~ }  » mount -f "$USERPROFILE" ~                                                           
{ ~ }  » mount -m > /etc/fstab

This comment has been minimized.

matthid commented Jul 1, 2017

Before I saw this thread I did something very similar to
mv /home/<user>/{*,.[^.]*,..?*} /c/Users/<user>/ && cd /home && ln -s /c/Users/<user> <user>
For now that seems to work perfectly. Just wanted to let you know. Maybe someone can even point out problems with this approach? Seems to be a simpler approach than the current suggestions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment