Score:1

Running Vagrant VM on Ubuntu 20.04 VM on VirtualBox on Windows 11 Host Machine, Need SSH access to vagrant from windows 11

cn flag

I am doing a computer vision project, and I have Vagrant VM on Ubuntu 20.04 VM on VirtualBox on Windows 11 Host Machine. I'd like to use the Windows 11 host machine for the CV since it needs a lot of processing power, and communicate with a python app in vagrant currently running using SSH, since it's not a very resource intensive app.

I have a port forwarded (8000 -> 8000) in virtual box to access the web interface of the app I need, and I can access it from my browser on Firefox in Windows 11.

The problem arises when I attempt to ssh into vagrant (2222->2222) putty gives an error for connection refused, windows cmd gives "kex_exchange_identification: read: Connection aborted"

I've tried getting private key, I've tried all variants of ssh commands that I could find, but it's simply not working. Inside Ubuntu I am able to simply type "vagrant ssh" and it will connect to the ssh without any delay.

Am I missing something?

I usually use WSL2 for programming in linux, but my particular application requires that it runs in vagrant in ubuntu.

port forwarding

vagrant ssh-config

  config.vm.box = "generic/ubuntu2010"

  # Publically forwarded ports.
  # The below ports are accessible to all machines on the same network.
  # To limit access to the local network, add "host_ip".
  config.vm.network "private_network", type: "dhcp"
  # Eg: config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  config.vm.network "forwarded_port", guest: 8000, host: 8000 # Web App
  config.vm.network "forwarded_port", guest: 9000, host: 9000 # Remote server
  #config.vm.network "forwarded_port", guest: 2222, host: 2222 # Remote server #<--this is commented because it didn't work, and vagrant's startup already specifies that it's forwarding port 22 to port 2222.
  #config.vm.network "private_network", type: "dhcp" #<-- so is this
  config.ssh.username = 'vagrant'
  config.ssh.password = 'test'
  config.ssh.insert_key = 'false' 

Vagrant's Startup

Nevermind, I'm an idiot. Installed openssh in ubuntu and was able to access vagrant.

Paul avatar
cn flag
Welcome to Server Fault! Your question, as written, doesn't seem to be a question as it contains its own resolution. If you would like to answer your own question, then please edit this question so it only contains a question, and then provide an answer with all applicable steps to resolve the issue. Be sure to read [How do I ask a good question?](http://serverfault.com/help/how-to-ask), [How do I write a good answer?](http://serverfault.com/help/how-to-answer), and don't forget to take the [site tour](http://serverfault.com/tour).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.