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

com.apple.vmnet is missing #37

Open
evanmcc opened this issue Sep 3, 2015 · 59 comments
Open

com.apple.vmnet is missing #37

evanmcc opened this issue Sep 3, 2015 · 59 comments

Comments

@evanmcc
Copy link

evanmcc commented Sep 3, 2015

the file /Library/Preferences/SystemConfiguration/com.apple.vmnet doesn't exist.

This leads to errors of the flavor:

The domain/default pair of (/Library/Preferences/SystemConfiguration/com.apple.vmnet, Shared_Net_Mask) does not exist
/usr/local/bin/dhyve: line 82: ( << 24) | ( << 16) | ( << 8) |  : syntax error: operand expected (error token is "<< 24) | ( << 16) | ( << 8) |  ")
/usr/local/bin/dhyve: line 82: ( << 24) | ( << 16) | ( << 8) |  : syntax error: operand expected (error token is "<< 24) | ( << 16) | ( << 8) |  ")
/usr/local/bin/dhyve: line 91: &  : syntax error: operand expected (error token is "&  ")

@nlf
Copy link
Owner

nlf commented Sep 3, 2015

it doesn't exist at all? what version of OSX are you on?

@evanmcc
Copy link
Author

evanmcc commented Sep 3, 2015

totally not there. Yosemite upgraded recently from Mavericks

@nlf
Copy link
Owner

nlf commented Sep 3, 2015

can you run the command sudo find / -name com.apple.vmnet.plist and tell me what it finds? it can take a while for that command to finish, but it should find the file somewhere.

@evanmcc
Copy link
Author

evanmcc commented Sep 3, 2015

no results, sadly.

@nlf
Copy link
Owner

nlf commented Sep 3, 2015

very interesting. i'll have to look into this deeper. @ailispaw ever seen this happen?

@jgeiger
Copy link

jgeiger commented Sep 3, 2015

Just had the same issue. no results for the find as well.
Yosemite 10.10.5 (14F27), full install, not an upgrade

@ailispaw
Copy link
Collaborator

ailispaw commented Sep 3, 2015

@nlf I've never seen that before.
@evanmcc @jgeiger Have you ever run xhyve successfully?
Could you try https://github.com/ailispaw/boot2docker-xhyve?
I guess that plist will be created when xhyve runs with vmnet at the first time.

@evanmcc
Copy link
Author

evanmcc commented Sep 3, 2015

@ailispaw that worked, thanks!

@nlf I had to recreate the vm afterwards (dhyve stop; dhyve destroy; dhyve init; dhyve up) to make this work, but it does seem to be working now.

@nlf
Copy link
Owner

nlf commented Sep 3, 2015

ok, great, thanks for letting me know. i bet we can work out a solution to this in the script.

@ailispaw
Copy link
Collaborator

ailispaw commented Sep 3, 2015

@evanmcc You're welcome. I'm glad that worked for you.

@jgeiger
Copy link

jgeiger commented Sep 4, 2015

running the b2d version fixed this issue for me. once started, the running instance hung after 3 commands so I had to kill it via kill -9

@therealprof
Copy link

Have the exact same problem but boot2docker-xhyve doesn't work for me because clang (tried different versions) persistently crashes while compiling uuid2mac.

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

@therealprof can you pull from master and try again with the latest version of the script and tell me if that works for you?

@therealprof
Copy link

Works fine, thanks.

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

did you get the warning about restarting the vm to setup nfs exports?

@therealprof
Copy link

Maybe the reply was too early... How long is it supposed to be starting up?

[dhyve] this command requires root, restarting with sudo..
Password:
[dhyve] starting.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

hmm, it should've started fairly quickly. can you check the output of ps aux | grep xhyve and see if the vm shows up?

@therealprof
Copy link

Still starting up but xhyve is not in the process list.

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

go ahead and hit control-c to stop the startup and try again, if it's not in the list something failed along the way.

@therealprof
Copy link

Tried to start it manually using the information from dhyve status and get the error:

virtio_net: Could not create vmnet interface, permission denied or no entitlement?

Seems like two things are foul: The vmnet stuff is not correct and dhyve does not detect that xhyve exited early due to problems.

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

the permission denied sounds like you didn't use sudo when trying to start it manually.

we do need to figure out how to detect a crash in xhyve though

@therealprof
Copy link

I did. ;)

sudo xhyve -A -m 2G -c 1 -s 0:0,hostbridge -l com1,stdio -s 31,lpc -s 2:0,virtio-net -s 4,virtio-blk,/Users/foo/.dhyve/disk.img -U 2996454B-06DE-43B0-9FC6-9E9F38D1DCAE -f kexec,/Users/foo/.dhyve/bzImage,/Users/foo/.dhyve/rootfs.cpio.xz,console=ttyS0 hostname=dhyve uuid=2996454B-06DE-43B0-9FC6-9E9F38D1DCAE
virtio_net: Could not create vmnet interface, permission denied or no entitlement?

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

try it like this with the quotes around the kernel command line

sudo xhyve -A -m 2G -c 1 -s 0:0,hostbridge -l com1,stdio -s 31,lpc -s 2:0,virtio-net -s 4,virtio-blk,/Users/foo/.dhyve/disk.img -U 2996454B-06DE-43B0-9FC6-9E9F38D1DCAE -f kexec,/Users/foo/.dhyve/bzImage,/Users/foo/.dhyve/rootfs.cpio.xz,"console=ttyS0 hostname=dhyve uuid=2996454B-06DE-43B0-9FC6-9E9F38D1DCAE"

@therealprof
Copy link

Same problem. But since the commandline was assembled by dhyve anyway I would expect it to work as is when called from dhyve, no? ;)

@nlf
Copy link
Owner

nlf commented Sep 12, 2015

very strange. ok i'll continue debugging on my end, thanks for the info!

@ailispaw
Copy link
Collaborator

Hi @therealprof ,
Thank you for trying boot2docker-xhyve.

because clang (tried different versions) persistently crashes while compiling uuid2mac.

Did you see any error messages on compiling uuid2mac?
If so, could you provide it for me?

And I would like to know the version of your Yosemite 10.10.x and vmnet.framework.

# for vmnet.framework
$ cat /System/Library/Frameworks/vmnet.framework/Resources/version.plist

@therealprof
Copy link

Did you see any error messages on compiling uuid2mac?

No, it just segfaults, same message with the standard Xcode clang:

tar zxvf boot2docker-data.tar.gz
x boot2docker-data.img
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C uuid2ip
ld uuid2mac.sym
clang-3.6: error: unable to execute command: Segmentation fault: 11
clang-3.6: error: linker command failed due to signal (use -v to see invocation)
make[1]: *** [build/uuid2mac.sym] Error 254
make: *** [uuid2ip/build/uuid2mac] Error 2

And I would like to know the version of your Yosemite 10.10.x and vmnet.framework.
cat /System/Library/Frameworks/vmnet.framework/Resources/version.plist

Yosemite is 10.10.5 (14F27)

BuildVersion : 23
SourceVersion : 122001001000000

@ailispaw
Copy link
Collaborator

@therealprof Thank you so much for the prompt reply.
Your versions are same as mine.

How about xhyve itself? Did you compile xhyve without any problems?

@therealprof
Copy link

I'm using the bottled homebrew xhyve version.

@therealprof
Copy link

dhyve is not working either... It all boils down to:

$ sudo ./xhyverun.sh
virtio_net: Could not create vmnet interface, permission denied or no entitlement?

@ailispaw
Copy link
Collaborator

It seems something wrong with libraries or framworks in your system, which xhyve uses.
I guess that you may not be able to compile xhyve from its source in your Mac and it's not related to dhyve but xhyve.

@ailispaw
Copy link
Collaborator

Or do you have any zombie processes of xhyve? If so, please kill all of them.

@therealprof
Copy link

brew install xhyve --HEAD is compiling directly from the git sources. As mentioned I've tried that but still no change.

The least thing that boot2docker-xhyve should do IMHO is to check whether /Library/Preferences/SystemConfiguration/com.apple.vmnet exists and bail out with a meaningful error message before causing lots of random error messages. ;)

No, there're no xhyve processes running.

@ailispaw
Copy link
Collaborator

I see. Yes, boot2docker-xhyve should do it.

Hmm. It seems I can not help you for now. I will investigate it.
Thank you for your time.

@ailispaw
Copy link
Collaborator

It looks similar to this.
https://llvm.org/bugs/show_bug.cgi?id=24732

Sorry for bothering you with boot2docker-xhyve things here.
I will open an issue at boot2docker-xhyve.

@apage43
Copy link

apage43 commented Sep 15, 2015

I'm seeing a similar issue, with a failure of virtio_net: Could not create vmnet interface, permission denied or no entitlement? (status = 1001) when trying to run any xhyve variant using vmnet.framework

I also see in Console.app when this happens the messages

9/15/15 3:23:19.926 AM com.apple.framework.netrb[78097]: error: Connection invalid
9/15/15 3:23:19.927 AM com.apple.framework.vmnet[78097]: interface 0x7f9f02003800, netrb client create failed

@apage43
Copy link

apage43 commented Sep 16, 2015

At least on my end, the issue I and @therealprof are having seems to have been caused by NAT/Network Sharing having been disabled on my mac. com.apple.NetworkSharing must be running for vmnet to work.

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.NetworkSharing.plist

Also NAT has to be enabled for NetworkSharing to run:

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 1

EDIT: After this I can run xhyve with working network, ping back and forth from the host and guest, but still am not seeing /Library/Preferences/SystemConfiguration/com.apple.vmnet get created.

@therealprof
Copy link

Hm, does not work for me:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.NetworkSharing.plist
/System/Library/LaunchDaemons/com.apple.NetworkSharing.plist: Operation already in progress

And NAT was already enabled.

xhyve is still complaining.

@edrex
Copy link

edrex commented Sep 23, 2015

Wow this is a long thread.

I think I have the same issue

% ls /Library/Preferences/SystemConfiguration/com.apple.vmnet
ls: /Library/Preferences/SystemConfiguration/com.apple.vmnet: No such file or directory

however it's being masked by #653b8e8c3 so I just see [dhyve] your vm has started, however since this is your first start we were unable to configure nfs shares. please run 'dhyve down' and then 'dhyve up' to restart the vm and enable the nfs share on every start.

Is this file meant to be created by the Yosemite installer?

@nlf
Copy link
Owner

nlf commented Sep 23, 2015

The current theory is that file is created when the network sharing has been used the first time. Note though, that the filename is /Library/Preferences/SystemConfiguration/com.apple.vmnet.plist

@edrex
Copy link

edrex commented Sep 24, 2015

Oh I have that file.

edrex added a commit to edrex/dhyve that referenced this issue Sep 24, 2015
The check for the vmnet config file is missing the `.plist` suffix. 

Further, when the check passes, the return code check on L313 fails with:

```
/usr/local/bin/dhyve: line 313: [: : integer expression expected
```

Bugs introduced in 653b8e8 to try to fix nlf#37.
@edrex
Copy link

edrex commented Sep 24, 2015

It turns out the script was giving a false negative because 653b8e8 left out the .plist suffix. @evanmcc, in the original report you are also missing the suffix. What does

ls /Library/Preferences/SystemConfiguration/com.apple.vmnet.plist

output?

@nlf
Copy link
Owner

nlf commented Sep 24, 2015

good eye, added in the .plist extension

@edrex
Copy link

edrex commented Sep 24, 2015

the other part of that commit is needed too, to avoid an error when the file exists. I swear I created a PR for that commit, but I can't find it now.

@nlf
Copy link
Owner

nlf commented Sep 24, 2015

i'm not sure i follow, i left the commit intact and only added the .plist extension to the test. what else am i missing?

@edrex
Copy link

edrex commented Sep 24, 2015

I had to change the test on L313 to avoid an error when the file exists (since the test expects an integer) , see the commit message and body of 9acf6f8.

@nlf
Copy link
Owner

nlf commented Sep 24, 2015

just pushed an update, should take care of that

@pr4th4m
Copy link

pr4th4m commented May 6, 2016

I am facing a similar problem

~/vm $ sudo ./up
virtio_net: Could not create vmnet interface, permission denied or no entitlement?

~/vm $ cat up
#!/bin/sh
KERNEL="boot/vmlinuz-4.4.0-21-generic"
INITRD="boot/initrd.img-4.4.0-21-generic"
CMDLINE="earlyprintk=serial console=ttyS0 acpi=off root=/dev/vda1 ro"

UUID="-U c4670d36-43fe-41d0-8748-2700fa951c5f"
MEM="-m 1G"
NET="-s 2:0,virtio-net"
IMG_CD="-s 3,ahci-cd,ubuntu-16.04.iso"
IMG_HDD="-s 30,virtio-blk,hdd.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"
ACPI="-A"
xhyve $ACPI $MEM $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f kexec,$KERNEL,$INITRD,"$CMDLINE"

~/vm $ xhyve -v
xhyve: 1300b4

xhyve is a port of FreeBSD's bhyve hypervisor to OS X that
works entirely in userspace and has no other dependencies.

Homepage: https://github.com/mist64/xhyve
License: BSD

~/vm $ ls /Library/Preferences/SystemConfiguration/com.apple.vmnet.plist
/Library/Preferences/SystemConfiguration/com.apple.vmnet.plist

~/vm $ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F1713

NOTE: If I run xhyve without $UUID OS boots up just fine, but I wish a same ip for every boot.

@therealprof
Copy link

Actually all of my problem just vanished this morning. Yesterday night I was looking through various log files again to find the reason for sporadic erratic behaviour of some applications (like the clipboard not working in the latest Chromium version) and in due course I discovered that there were some old files in /var/run and /var/db which were not supposed there and couldn't be removed. So I booted into Recovery and did a little spring cleaning, including disabling rootless mode and removing those bogus files and plenty of others which haven't been touched since 2011; sure enough after a reboot dhyve, xhyve, Veertu and the Docker for Mac Beta didn't have any problems wrt to networking anymore.

Not exactly sure what exactly was the culprit here but something most certainly was.

NB: This system has been updated all the way from Leopard so if you have a senior system, you might want to check for any leftovers...

@pr4th4m
Copy link

pr4th4m commented May 6, 2016

Found it !! In my case culprit was UUID (I have no idea why)

May  6 15:03:26 MacBook-Air.local sudo[17863]: prathamesh.nevagi : TTY=ttys005 ; PWD=/Users/prathamesh.nevagi/vm ; USER=root ; COMMAND=./up
May  6 15:03:26 MacBook-Air com.apple.xpc.launchd[1] (com.apple.ftp-proxy): Unknown key for Boolean: ForceEnableHack
May  6 15:03:26 MacBook-Air.local InternetSharing[17866]: mac address conflict with given uuid
May  6 15:03:26 MacBook-Air.local InternetSharing[17866]: unable to get MAC address

By changing the UUID I get same IP across reboots.
Weird part is, I had picked the UUID randomly the firs time as well.

@nhooey
Copy link

nhooey commented Jan 26, 2017

@therealprof I'm having all of the same issues that you're having.

What exactly did you remove in /var/db and /var/run?

@nhooey
Copy link

nhooey commented Jan 26, 2017

I posted a Stack Overflow question since it's a better forum to answer these sorts of things.

@therealprof
Copy link

@nhooey I'm sorry but I have really no idea what exactly did the trick. It was simply some severe pruning and suddenly things worked again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants