chtenb
chtenb

Reputation: 16194

How to make babun/cygwin home directory equal windows home directory?

I just installed babun, a variant of Cygwin. I want the cygwin user home directory to equal my windows home directory. So, to be clear, I don't want to add the cygwin home to the C:\Users as a new user, I want it to be the same as my current windows home directory.

Now, according to this post, How can I change my Cygwin home folder after installation?, there is a neat way to make the cygwin home directory point to your windows home directory. You open the file /etc/nsswitch.conf and make sure is has a line db_home: windows. However, after restarting my pc, echo $HOME still says /home/chiel.tenbrinke, which is not what is should be. It should say something like /cygdrive/c/Users/Chiel.tenBrinke.

Why is this not working?

My cygwin version is CYGWIN_NT-6.1-WOW IM-Chiel-2015 1.7.35(0.287/5/3) 2015-03-04 12:07 i686 Cygwin.

Upvotes: 5

Views: 2581

Answers (3)

silicis
silicis

Reputation: 1

in /etc/nsswitch.conf

db_home: /cygdrive/c/Users/%H

Upvotes: 0

Jianyu
Jianyu

Reputation: 422

I tried an easier way and works perfectly so far.

Just mv your home folder to the location you want, and make a symlink

The first execution after move may prompt errors, run babun install will fix everything.

Upvotes: 0

ouwen
ouwen

Reputation: 41

Babun has a surprisingly good FAQ. The last entry in the FAQ is How to Use the Windows home directory as Babun's home directory?

For me, it boiled down to:

  1. Create an env var for $HOME = /Users/my_account_name via Win+R sysdm.cpl
  2. Run mkpasswd -l -p "$(cygpath -H)" > /etc/passwd
  3. Run babun install

I'm not sure why Babun doesn't recognize the standard cygwin setting in /etc/nsswitch.conf, and I'm a bit surprised there was no mention of this setting in the Cygwin FAQ. I'm a bit concerned that in spite of what a great collection Babun is, it may fall out of sync with Cygwin quickly if not properly maintained.

Upvotes: 4

Related Questions