Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No IP address when using the VirtualBox driver #1262

Closed
SchnuckySchuster opened this issue Dec 20, 2019 · 16 comments
Closed

No IP address when using the VirtualBox driver #1262

SchnuckySchuster opened this issue Dec 20, 2019 · 16 comments

Comments

@SchnuckySchuster
Copy link

SchnuckySchuster commented Dec 20, 2019

Hi there,
I realise that there is the closed issue "Instances has no IPv4 address #839", but please continue reading

  • I'm working on MacOS Catalina 10.15.2
  • I'm using "multipass 1.0.0+mac" version
  • I'm on a MacBook
  • I'm connected via WLAN

I run the following commands

multipass launch
multipass ls

I see

Name State IPv4 Image
spacious-gryphon Running N/A Ubuntu 18.04 LTS

The entire rest of the world seems to get something like this

Name State IPv4 Release
microk8s-vm Running 10.141.241.164 Ubuntu 18.04 LTS

Why do I see no IPv4 address?

I can ping out to the internet

multipass exec spacious-gryphon ping google.com
PING google.com (216.58.207.46) 56(84) bytes of data.
64 bytes from fra16s24-in-f14.1e100.net (216.58.207.46): icmp_seq=1 ttl=63 time=14.5 ms
64 bytes from fra16s24-in-f14.1e100.net (216.58.207.46): icmp_seq=2 ttl=63 time=21.1 ms
64 bytes from fra16s24-in-f14.1e100.net (216.58.207.46): icmp_seq=3 ttl=63 time=20.9 ms

But I can not ping my "spacious-gryphon" as I have no IPv4 address.

13:14:37 ~ > multipass info spacious-gryphon
Name: spacious-gryphon
State: Running
IPv4: N/A
Release: Ubuntu 18.04.3 LTS
Image hash: 6afb97af96b6 (Ubuntu 18.04 LTS)
Load: 0.00 0.00 0.00
Disk usage: 999.5M out of 4.7G
Memory usage: 71.9M out of 985.5M

@Saviq
Copy link
Collaborator

Saviq commented Dec 20, 2019

Hi @SchnuckySchuster, you're using the VirtualBox backend, right? The problem with VBox's default networking is that it is not accessible from the host, so it seemed wrong to show it in multipass list or multipass info output.

If you switch to the default hyperkit backend, (see our forum post on that), you'll see the IPs.

We'll enable more networking options (#118, #309) in due course, bear with us!

In the mean time, we'll improve our documentation on this.

@Saviq Saviq changed the title No IPv4 address when launching a multipass instance on MacOS Catalina 10.15.2 No IP address when using the VirtualBox driver Dec 20, 2019
@Saviq Saviq added the question label Dec 20, 2019
@SchnuckySchuster
Copy link
Author

Well, what shall I say, that was the problem.
I did not use the VirtualVox backend on purpose.
I might have copied a command line from an internet post or may be as I have VirtualBox installed I might have thought that it would be a good idea to use it.
Thanks a lot for your help.
I would not have been able to solve the problem on my own.

@gino2010
Copy link

gino2010 commented Jan 5, 2020

I met same problem, when I set up microk8s env in multipass vm:
why I want to use driver as virtualbox, because I need to use VPN network to install packages related k8s
when I use virtualbox, the networking is NAT mode, that works for me in VPN.
(in hyperkit mode, vm network traffic can't be forwarded to VPN, I think that's a network router problem, if you have idea, please let me know)
But in virtualbox mode, I can't expose service out of multipass vm, I can't access microk8s service from host(mac os x)

Hope multipass supports virutalbox better ASAP

@Saviq
Copy link
Collaborator

Saviq commented Jan 8, 2020

Hi @gino2010 indeed it's a routing problem, you'd need to tell your VPN software to route traffic from the br100 bridge out the VPN when using hyperkit.

With VirtualBox, however, you can use the port forwarding features to expose ports from the instance on your localhost. Just run sudo VirtualBox to get the GUI and go from there, or use sudoVBoxManage modifyvm ….

@gino2010
Copy link

gino2010 commented Jan 9, 2020

Hi @Saviq
Thank you for your idea, that's really helpful for me

@salerio-gs
Copy link

I faced this problem, but it seems on my system that VBoxManage has no knowledge of the VM multipass created, thus I can't do any port mapping

@indrayam
Copy link

indrayam commented Feb 7, 2020

@Saviq Are you saying that despite the fact that “multipass list” command does not display any IP when the local.driver is VirtualBox, that there is still a way to access ports (like Nginx or Kubernetes API server ports) from the local host? Any pointers/documentation on how to do it?

@Saviq
Copy link
Collaborator

Saviq commented Feb 7, 2020

@salerio-gs did you use psexec.exe -s before the VBoxManage command?

@indrayam yes, by means of VBox's internal port forwarding. See the vboxmanage manual I mentioned above.

@salerio-gs
Copy link

@Saviq no

@Saviq
Copy link
Collaborator

Saviq commented Feb 7, 2020

@salerio-gs you'll need that, the VMs are defined under the SYSTEM user's VirtualBox profile.

@indrayam
Copy link

indrayam commented Feb 8, 2020

@Saviq Ok, I am a bit lost.

Setup:

  • MacOS Catalina 10.15.3
  • VirtualBox 6.1.2
  • multipass 1.0.0+mac
  • multipassd 1.0.0+mac

My local.driver setting is virtualbox. I launched a VM using multipass CLI on my Mac. multipass list shows a VM. I can multipass ssh into it. But when I run vboxmanage list vms command, or try to see the VM in VirtualBox UI, I do not see it.

vboxmanage-multipass

If I try to use vboxmanage modifyvm command, I will need to get UUID to even begin setting up a port forwarding. How do I setup port forwarding without an actual VM that vboxmanage can be addressed to?

Thoughts?

@Saviq
Copy link
Collaborator

Saviq commented Feb 9, 2020

@indrayam on macOS you need to run sudo vboxmanage list vms - the daemon runs as the root user and that's where you need to look for them.

@indrayam
Copy link

indrayam commented Feb 9, 2020

Thanks @Saviq. That indeed did the trick. However, it begs the question: Is there a way to run multipass and multipassd as a regular (non-root) user so that I do not have to run

vboxmanage list vms and
sudo vboxmanage list vms

to see all my VirtualBox VMs.

In any case, I do appreciate you helping me solve this riddle. I was really stumped where my VirtualBox VMs were 😄

~Anand

@Saviq
Copy link
Collaborator

Saviq commented Feb 12, 2020

Thanks @Saviq. That indeed did the trick. However, it begs the question: Is there a way to run multipass and multipassd as a regular (non-root) user so that I do not have to run

Hi @indrayam, not at the moment, I'm afraid. Multipass is (on purpose) a system-wide service, so there's no way to bind it to your account.

@AntonOfTheWoods
Copy link

It would be really great to have instructions on how to manage this using VirtualBox on Windows 10. Things are super easy with sudo on *nix but instructions on how to get this done practically (like, so you can get output from commands, etc.) on Windows are very hard to find. It makes multipass very hard to get started with on Windows 10 Home

@Saviq
Copy link
Collaborator

Saviq commented Oct 27, 2021

You can now use --network to get extra interfaces with valid IPs.

@Saviq Saviq closed this as completed Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants