If you prefer to work from the host environment, you can use any combination of browsing and editing tools that support SSH. You'll still need to run helper scripts, restart services, and commit changes as usual. You can get the ssh connection information by running vagrant ssh-config, e.g.
$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/$USER/Projects/vagrant/twlight_vagrant/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
ForwardAgent yes
Where $USER is your linux username
You will need to modify the IdentityFile path above in order to access the private key from a Windows application. Modifying Windows Subsystem for Linux files outside of the linux environment will break your linux environment, but allowing your application to read the SSH key should be safe. The location of your home directory differs between store-based installs (recommended, what you probably have) and lxrun-based installs (deprecated). All references here will be for the store-based Ubuntu install.
The store-based Ubuntu home directory is:
%localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_$somevalue\LocalState\rootfs\home\$USER
where $USER is your linux username and $somevalue is not consistent across installations. For convenience, you may run bin/get_winpath_for_wsl_homedir.sh from the twlight_vagrant directory in Ubuntu, which will print the windows path to your Ubuntu home directory:
./bin/get_winpath_for_wsl_homedir.sh
To that path, add the path to the private key for the TWLight Vagrant machine that gets created upon "vagrant up." For example
Projects\vagrant\twlight_vagrant\.vagrant\machines\default\virtualbox\private_key
In this case, the full path to your TWLight Vagrant machine's IdentityFile would be something like:
%localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_$somevalue\LocalState\rootfs\home\$USER\Projects\vagrant\twlight_vagrant\.vagrant\machines\default\virtualbox\private_key
FileZilla is a multiplatform FTP, FTPS, and SFTP client that can work with pretty much any host-side application.
- Under File, select "Site Manager"
- Click "New Site"
- Give the site a creative name, such as "twlight_vagrant" and click OK
- Set the following values:
General:
Host: vagrant ssh-config HostName
Port: vagrant ssh-config port
Protocol: SFTP - SSH File Transfer Protocol
Logon Type: Key file
User: vagrant
Key file: vagrant ssh-config IdentityFile (Windows users modify path as noted)
Advanced:
Default remote directory: /var/www/html/TWLight
- Click "OK"
You may now use your saved site to browse and edit files in the guest, as well as drag and drop files from your host system into the guest.
Cyberduck is a general-purpose cloud and server storage browser that can work with pretty much any host-side application.
- Under Edit, select "Preferences"
- Under General, set "Default protocol" to "SFTP (SSH File Transfer Protocol)"
- Under Editor, set the default text editor to the application of your choice
- Click "Open Connection"
- Expand the "More Options" section.
- Set the following values:
Protocol: SFTP (SSH File Transfer Protocol)
Server: vagrant ssh-config HostName
Port: vagrant ssh-config port
Username: vagrant
SSH Private Key: vagrant ssh-config IdentityFile (Windows users modify path as noted)
Save Password: Unchecked
Path: /var/www/html/TWLight
- Click "Connect"
- Under Bookmark, Select "New Bookmark"
- Give the bookmark a creative name, such as "twlight_vagrant" and close the window
- You can now toggle bookmarks under the Bookmark menu
You may now use your bookmarked connection to browse and edit files in the guest, as well as drag and drop files from your host system into the guest.
Notepad++ is a Windows-only text/code editor with a rich plugin ecosystem. You can configure it to directly manage files via SSH by using an unstable plugin.
- Under Plugins -> Plugin Manager, Select "Show Plugin Manager"
- Under Settings, Select "Show unstable plugins" and click OK
- Attempt to install the NppFTP plugin.
- You will be prompted to update the plugin manager before proceeding with the NppFTP installation. Allow the update, but when asked if you would like to automatically restart, select "No", then manually exit.
- Open Notepad++ again and install the NppFTP plugin.
- Under Plugins -> NppFTP, select "Show NppFTP Window"
- Under the Settings gear, Select "Profile settings"
- Click "Add new"
- Give the profile a creative name, such as "twlight_vagrant" and click OK
- Set the following values:
Connection:
Hostname: vagrant ssh-config HostName
Connection type: SFTP
Port: vagrant ssh-config port
Username: vagrant
Initial remote directory: /var/www/html/TWLight
Authentication:
Try private key file authentication: Checked
Try password authentication: Unchecked
Private key file: vagrant ssh-config IdentityFile (Windows users modify path as noted)
You may now use the (Dis)Connect icon in the NppFTP window to browse and edit files in the guest, as well as drag and drop files from your host system into the guest.