ChromeOS has native WireGuard support, but the built-in terminal (crosh) cannot directly import .conf files. Furthermore, crosh lacks common shell piping/utilities (like echo) and rejects multi-line pasting or whitespace spaces in arguments like allowed-ips.
This script parses a standard WireGuard configuration file and generates individual, copy-pasteable command blocks optimized for the strict crosh shell environment.
Run the script inside your Linux development environment (Crostini):
python wg_to_crosh.py <path_to_file.conf> [optional_custom_name]
- If no custom name is passed, the script automatically uses the filename (e.g.,
Stark.confbuilds a profile namedStark).
Because crosh treats multi-line pastes as single-line arguments and handles key inputs via interactive hidden fields, you must copy and paste the commands one single line at a time:
- Open crosh in ChromeOS by pressing
Ctrl + Alt + T. - Step 1: Triple-click each command line individually, paste it into crosh (
Ctrl + Shift + V), and press Enter. - Step 2 (Private Key):
- Triple-click and execute the
wireguard set ... private-keycommand. croshwill halt and show a hiddenEnter private key:prompt.- Triple-click the raw key string printed directly below it by the script, paste it into the prompt, and press Enter.
- Triple-click and execute the
- Step 3: Triple-click and run each peer configuration command.
- Step 4 (Preshared Key): If your provider (like
wg-easy) requires a PSK, execute the command line, then copy and paste the raw key string directly into the hiddencroshprompt.
Once all steps are finished, verify your connection inside crosh:
wireguard list
The profile will now natively show up in your ChromeOS System Settings -> Network -> VPN section. Click Connect to initialize the tunnel!