Troubleshooting

Timezone is wrong

By default, both WSL and LXD use UTC as the default timezone. To set another timezone, use time.timeZone:

# configuration.nix
{
    time.timeZone = "Europe/Berlin";
}

Linux: Graphical Applications don't Work

When opening graphical applications inside a code machine you might encounter an error like this:

Error: Can't open display

Although Codchi does its best to make the X-Server available inside a code machine (which is a LXD container on Linux), there can be issues with authentication against the host's X-Server. Codchi tries to set the Xauthority cookie. If this fails, you can try to allow all local connections to the X-Server (although this may be somewhat insecure):

xhost +local:

WSL: Failed initializing Driver

Currently, the codchistore file system may get corrupted, rendering Codchi unusable. The error looks something like this:

Failed initializing Driver.: LinuxCommandBuilder { driver: LinuxCommandDriver { instance_name: "codchistore" }, program: Run { program: "/sbin/init", args: [] }, user: None, cwd: Some(LinuxPath("/")), cmd: "wsl.exe" "-d" "codchistore" "--cd" "/" "--" "run" "/sbin/init" } failed with exit status ExitStatus(ExitStatus(1)). Stderr:
<3>WSL (9) ERROR: CreateProcessParseCommon:809: getpwuid(0) failed 2
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Users\Dev\AppData\Roaming\codchi
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Users\Dev\AppData\Local\codchi
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\WINDOWS\system32
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\WINDOWS
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\WINDOWS\System32\Wbem
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\WINDOWS\System32\WindowsPowerShell\v1.0\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\WINDOWS\System32\OpenSSH\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Intel\WiFi\bin\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Common Files\Intel\WirelessCommon\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\ProgramData\chocolatey\bin
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\dotnet\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\starship\bin\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\PowerShell\7\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Tailscale\
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Docker\Docker\resources\bin
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Program Files\Neovim\bin
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Users\Dev\AppData\Local\Microsoft\WindowsApps
<3>WSL (9) ERROR: UtilTranslatePathList:2852: Failed to translate C:\Users\Dev\AppData\Local\Programs\Git\cmd
<3>WSL (9) ERROR: CreateProcessCommon:392: getpwuid(0) failed 2
<3>WSL (9) ERROR: CreateProcessCommon:559: execvpe(/bin/sh) failed: No such file or directory

To resolve this, run the command codchi store recover, after which Codchi should work again.