

By default, WSL sets the uid and gid to the value of the default user (in Ubuntu distro, the default user is created with uid=1000,gid=1000). If you want to explicitly specify those options, you must include every drive for which you want to do so in /etc/fstab. Options that the mount binary would normally parse into a flag are not supported. These can be found in an earlier blog post. Only DrvFs-specific options can be specified. This value is appended to the default DrvFs mount options string. For example, if you have a directory in WSL at “/windir/” and you specify that as the root, you would expect to see your fixed drives (for example, C:/) mounted at “/windir/c” This key lets you define a new directory where fixed drives will be automatically mounted. Thus, you can mount these filesystems automatically in WSL on start up. etc/fstab is a file where you can declare other filesystems, like an SMB share. Setting to true causes the file /etc/fstab to be processed on WSL start. Setting to false means they won’t be mounted automatically-but you could still mount them manually or via fstab. Setting to true causes your fixed drives (i.e C:/ or D:/) to be automatically mounted with DrvFs under “/mnt”. Below are key-values that can be set: Section: automount Key: enabled In WSL today, we have two sections: “automount” and “network”. ini conventions, keys are declared under a section. Notice how I must exit and reload WSL after making the change to wsl.conf so that WSL reads in my changes on launch. In the example below, I’ll tell WSL that I would like my drives to mount automatically with metadata enabled. Below is a sample that you could drop into your distros: If the file is missing or malformed (that is, improper markup formatting), WSL will continue to launch as normal. WSL will detect the existence of the file and will read its contents. If the file is not there, you can create it yourself. Wsl.conf belongs under the path /etc/wsl.conf. In order for a user to take advantage of this feature, they had to unmount and re-mount DrvFs each time they launched WSL–this is not the case any longer. For example, we released a blog post in the past about file system improvements in DrvFs. We’re introducing a file called wsl.conf to handle these configurations.

This includes automount options and network configuration.

Beginning with Insider Build 17093, we added a method for you to automatically configure certain functionality in WSL that will be applied every time you launch the subsystem.
