Is there a way to ssh into the VM? #2465
Replies: 12 comments 32 replies
-
Duplicate of #2280 |
Beta Was this translation helpful? Give feedback.
-
You can use port forwarding but it still requires using the GUI. |
Beta Was this translation helpful? Give feedback.
-
@osy How to do this? Is there any guide? I think this should be a common question, since now there are MAC users using UTM vm. |
Beta Was this translation helpful? Give feedback.
-
I had this working great using port-forwarding to ssh into Ubuntu VMs running in UTM (as described here) - but I'm actually here because this has stopped working! I have just updated Big Sur to 11.4 and also took an update to UTM Version 2.1.1 (30) since the last time I used it, so I am not sure which of these updates has caused it to stop working 😢 Port forwarding is set up to forward 2200 on the host to 22 on the guest. Debug output from ssh on the host is now
Any assistance or pointers gratefully received |
Beta Was this translation helpful? Give feedback.
-
Is the more recent versions, utm: 3.0.4-2 |
Beta Was this translation helpful? Give feedback.
-
a great explanation here https://www.youtube.com/watch?v=GgDEwQXpZI8&ab_channel=ryd3v by Ry about UTM networking, and also encountered an error on SSL connection from host to VM. Can connect to VM1 to VM2 and vice versa, VMs to Host. Also tried minimal |
Beta Was this translation helpful? Give feedback.
-
First run
If you can't ssh in using this method, make sure
Then try sshing again. Hopefully this works for you. |
Beta Was this translation helpful? Give feedback.
-
If your host is on a VPN, the guest may not be able to acces WAN over
Now the guest can access WAN over the first interface, and the host can SSH to the guest over the second. You may need to use |
Beta Was this translation helpful? Give feedback.
-
I'm running it as "shared network" which is the only way I can ssh to it at all- but even then SSH only works inside the LAN (edit: and only on the host). From outside, with the router set to forward to the guest's IP at port 22 (from a DuckDNS URL), there's no response. I've tried everything and I think this bit about the subnet is where it's going wrong... the third octet isn't shared between the host and guest's IPs. I tried setting the "guest network" to, ex. 192.168.64.0/24 but then the VM won't even start. |
Beta Was this translation helpful? Give feedback.
-
SSH INTO UTM VIRTUAL MACHINE - A GUIDE!To save the sanity future me out as I'll definitely be back here again I'll show what I've done that's worked for my Linux virtual machines. I hope this manages to help some other people out as well!
Here's a screenshot with the settings mentioned above (For future reference: taken September 2023):
Here's the screenshots with the above settings added in UTM (For future reference: taken September 2023):
Press Steps 3-4 should be done in your virtual machine!!
sudo apt install openssh-server
systemctl enable ssh.service
# If the above command doesn't work try the following command:
systemctl enable sshd.service
ssh <username>@localhost -p <port number> OR ssh <username>@127.0.0.1 -p <port number>
With this I have been able to start using other architectures on my Apple ARM machine as using these operating systems with their desktop interfaces was far too laggy and slow. Just make the VM headless and SSH into it! If you're familiar with a terminal as well this makes things so much easier as now you can copy and paste from the host machine without having to worry about clipboard sharing. Like I said earlier, these settings and whatnot have been successful for me and now I want to keep them here in the likely case I forget these settings and steps. I had been banging my head against this problem for almost 12 hours over the course of a few days just to get this working. I hope you all find this useful as it took me some time to type. :) Have fun with your brand new ssh connection now!!
P.S. I'll use a VPN when I am out and about as well, this shouldn't change anything but I'll be sure to update it if this isn't the case! [EDIT: I have been able to use this when connected to a VPN on my host machine.] |
Beta Was this translation helpful? Give feedback.
-
I can do a |
Beta Was this translation helpful? Give feedback.
-
Helpful page with step by step directions |
Beta Was this translation helpful? Give feedback.
-
Describe the issue
I don't wanna fiddle with the GUI inside the VM as i usually ssh into the VM. With QEMU, it usually requires some kind of network bridge on the host, then the VM is launched using that bridge as the underlying network device. Could you please advise how to do that on an M1 macbook? Thanks.
Configuration
Beta Was this translation helpful? Give feedback.
All reactions