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

让人想犯罪 __ 提交于 2019-12-07 05:53:45

问题


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.


回答1:


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.




回答2:


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.




回答3:


in /etc/nsswitch.conf

db_home: /cygdrive/c/Users/%H



来源:https://stackoverflow.com/questions/36011250/how-to-make-babun-cygwin-home-directory-equal-windows-home-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!