DEV Community

Cover image for A Step-by-Step Guide: SSH into Your Parallels Ubuntu VM from a Mac
0xkoji
0xkoji

Posted on

A Step-by-Step Guide: SSH into Your Parallels Ubuntu VM from a Mac

Running Ubuntu on Parallels Desktop is a fantastic way to develop on a Mac. However, working inside the virtual machine's window isn't always the most comfortable experience. Sometimes, you just want to stay in your native macOS Terminal, where all your familiar settings and shortcuts live.

Setting up SSH access from your Mac host to your Ubuntu guest OS is the perfect solution. Here is a quick, step-by-step guide on how to get it done.

1. Check Network Configuration

First, make sure that your guest OS network setting is configured correctly. Your virtual machine needs to use the Shared Network option.

If you haven't modified any advanced configurations in Parallels Desktop, your guest OS uses Shared Network by default, so you probably don't need to change anything here.

2. Setup OpenSSH Server (Ubuntu Side)

By default, Ubuntu desktop environments usually don't come with the SSH server installed and running. Open the terminal inside your Ubuntu virtual machine and run the following commands to set it up:

# update package list
sudo apt update

# install SSHserver
sudo apt install openssh-server -y

# start SSH service
sudo systemctl start ssh

# check ssh server service
sudo systemctl status ssh
Enter fullscreen mode Exit fullscreen mode

If you see active (running) in green text, you are good to go!

3. Find Your IP Address and Username (Ubuntu Side)

o connect from your Mac, you need to know exactly where to connect and who you are connecting as.

Check the IP address:

hostname -I
Enter fullscreen mode Exit fullscreen mode

You will see an IP address output. For Parallels Desktop using a Shared Network, it typically looks something like 10.211.55.xxx. Note this down.

Check your exact username:

whoami
Enter fullscreen mode Exit fullscreen mode

Depending on how you set up the VM, you will probably see parallels, or perhaps your own name. Make sure to use the exact output from this command.

4. Connect via SSH from Mac

Now, switch back to your Mac and open your native Terminal app. Use the ssh command using the username and IP address you just confirmed:

# your_username: whoami
# your_ip_address: hostname -I
ssh <your_username>@<your_ip_address>
Enter fullscreen mode Exit fullscreen mode

Things to keep in mind during your first connection:

You might see a message asking: Are you sure you want to continue connecting?. Type yes and press Enter.

When prompted for a password, use your Ubuntu user password, not your Mac login password or Parallels account password.

When typing your password, nothing will show up on the screen. This is normal security behavior—just type it and press Enter.

That’s it! You now have full terminal access to your Ubuntu VM directly from your Mac. Happy coding!


Troubleshooting Common Issues

Even with the right steps, you might run into a couple of common hiccups. Here is how to fix them.

1. Connection Timeout (No Response)

If you type the ssh command and nothing happens until it eventually times out, your Mac cannot reach the Ubuntu VM.

  • Double-check the IP Address: Did you make a typo? Parallels Shared Network IPs usually start with 10.211.55.. Make sure you didn't accidentally type 10.221... or another variation.
  • Check the Firewall (Ubuntu side): Sometimes, the Ubuntu firewall blocks SSH connections by default. Run this in your Ubuntu terminal to allow SSH traffic:
sudo ufw allow ssh
sudo ufw reload

Enter fullscreen mode Exit fullscreen mode
  • Verify Network Settings: Go to your Parallels VM Configuration > Hardware > Network, and ensure the Source is set to Shared Network.

2. Password Authentication Fails (Permission Denied)

You connect successfully, but it keeps rejecting your password.

  • Use the right password: The terminal is asking for the Ubuntu virtual machine's login password (the one you use to unlock the Ubuntu desktop). Do not use your Mac host password or your Parallels Desktop account password.
  • Verify your username: Are you sure your username is parallels? Run whoami inside Ubuntu again to be 100% sure. If your username is john, your command must be ssh john@10.211.55.x.
  • Keyboard layout mismatch: Since passwords are hidden while typing, a different keyboard layout (like US vs. JIS) might cause you to type the wrong special characters. Try typing your password in a visible text editor on your Mac, copy it, and paste it into the terminal when prompted.

Top comments (0)