Applications can be developed in Visual Studio Code using the Remote-SSH extension using a SSH key to avoid constantly having to type in your password, just remember not to enter a passphrase when generating the key in this case.

Create and/or navigate to your users .ssh folder in Windows 10, and generate a rsa key pair:

# Generate SSH Keys
ssh-keygen

Enter the filename to save the key:

Enter file in which to save the key (C:\Users\User/.ssh/id_rsa): serf_rsa

Enter a passphrase to password protect the private key or leave it blank for local environments:

Enter passphrase (empty for no passphrase):

Verify the passphrase if required:

Enter same passphrase again:

The key pair will be generated with details as per below:

Your identification has been saved in serf_rsa.
Your public key has been saved in serf_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+---[RSA 2048]----+
|           ox.   |
|   . X .  o.o o  |
|    x =. .   = o |
|   . oo.  . . *.o|
|    XxX.Xx X X +x|
|   .X.x X = X    |
|    =+0o.        |
+----[SHA256]-----+

Copy the public key to the server:

scp C:\Users\$ENV:USERNAME\.ssh\serf_rsa.pub user@192.168.1.201:~

In an SSH connection add the public key to the authorized keys:

cat ~/.ssh/serf_rsa.pub | cat >> ~/.ssh/authorized_keys

Create or modify a config file in the .ssh folder in Windows 10:

Host 192.168.1.201
  HostName 192.168.1.201
  User odin
  IdentityFile C:\Users\User\.ssh\serf_rsa

SSH via Windows Terminal can now be used to manage the VM via remote access.

For copying files in and out of the VM without setting up Samba, WinSCP can be used via SSH using the private key to prevent password prompts.

Once setup the entire development environment VM can be backed up so if there is a catistrohpic issue it can bre restored rather than rebuilding it from scratch.

Copyright Chad Tomlinson. All rights reserved.