Setting Up 🖥️ A Virtual Machine¶
In this guide, you'll learn how to set up and manage a virtual machine (VM). A VM is an essential tool for isolating environments, testing new configurations, and running applications without affecting your main system. This guide will walk you through the process step by step.
Manage the VM¶
Need Help?
If you ever get stuck or run into trouble, don't hesitate to contact the "mods" on Discord or just send a message in the server! 💬
Useful Tips on Variables
When filling out the values of the variables, don't include the <>
but fill in the appropriate value.
<local-username>
: The local username on your computer
<vm-manager-ip>
: 130.208.246.206
<vm-ip>
: The IP of the VM you created via VM Manager
<priv-key-path>
: This should be the path to your private SSH key. (do not include .pub
). For example, if your key is stored in C:\Users\YourUsername\.ssh\id_rsa
, you would specify that as the path.
<username>
: The username created for you on the VM (Sent to you after you send us your SSH key)
Available commands within VM Manager
vm-manager.py show
-> Shows information about VMs running
vm-manager.py create
-> Create VM
vm-manager.py start
-> Start VM
vm-manager.py stop
-> Stop VM
vm-manager.py delete
-> Delete VM
A. Generate a SSH key¶
If you have not already created a ssh-rsa key, follow these instructions.
B. Send the public SSH key to us¶
After generating the key, (for now) we will need to create your account. Please send the "mods" on Discord the key .pub key.
C. Connect to the VM Manager¶
Connecting to the VM Manager
In your terminal, type..
You will get a prompt Are you sure you want to continue connecting (yes/no/[fingerprint])?
. Write yes
.
Then the prompt Enter passphrase for key 'C:\Users\Username/.ssh/id_rsa':
will come up and there you enter your password for the key. Remember this password to be able to use the key.
See all available commands within VM Manager here
D. Create and start your VM¶
1. Create your VM¶
You will have to wait for it to finnish setting up and will recieve the prompt VM started successfully.
when it's done.
2. Show VM to see the IP¶
There you see in the output on the terminal something something like:
Take note of the IP located at 130.208.246.2XX
. That is your <vm-ip>
- (XX is a placeholder for the rest of the ip since this can vary between users)
2. SSH Configuration¶
A. Editing your config file¶
If you are still connected to the VM start by logging of the session like so:
1. Backup the Config
Open Terminal to create a backup of your config file. If you the file does not exist, continue with the next step.
2. Edit/Create the SSH Config File
Edit the local config file on your computer
Once the file is open, you can add the following configuration:
(See variables at the top of this page if you are confused what to replace the contents of <>
with )
3. Save changes
To do so, press:
Control + X
than write Y
1. Backup the Config
First, check if the SSH config file already exists by running this in PowerShell:
If the config file does not exist, create it:
If the config file already exists, create a backup to avoid losing your current settings:
2. Edit the SSH Config File
Open the config file in a text editor like Notepad:
Once the file is open, you can add the following configuration:
Replace <username>
, <vm-manager-ip>
, and <vm-ip>
with the variables found at the top of this document.
3. Save changes
Save and exit the editor when done.
B. Create agent and assign private key to it¶
Creating an SSH agent allows you to securely manage your SSH keys without needing to enter the passphrase each time you connect to a VM. Follow these steps to set up and use an agent:
- Create the agent
- Assign your private key to the agent
- Start the SSH Agent:
This starts the SSH agent service. If it's already running, you'll be notified.
Note: If this does not work, you can try the following command and then try again Get-Service -Name ssh-agent | Set-Service -StartupType Manual
- Add Your Private Key to the Agent:
Replace C:\Users\<username>\.ssh\id_rsa
with the actual path to your private SSH key file.
- To verify that your key has been added, you can run:
C. Connect to the VM¶
Now, having done the previous steps you should be able to connect to the VM!