How to change the home folder in cygwin

cygwin;

I've installed cygwin on my work computer. The problem is that my my computer is part of a domain and cygwin is using my network home folder as my home folder every time it launches. I would like to have my home folder set to a folder on my local machine instead.

How do I do this?

Best Answer

First of all make sure your domain user is added to /etc/passwd:

mkpasswd -d >> /etc/passwd

Then just edit /etc/passwd and let it point to your desired directory. For example my entry looks as follows:

myuser:unused:11555:10513:U-DOMAIN\myuser,S-1-5-21-3223550679-1857247031-121334384-2459:/cygdrive/c/Users/myuser/AppData/Roaming/cygwin/home:/bin/bash

This places the cygwin home directory within my roaming profile folder within my user profile.