Closed johanneswuerbach closed 8 years ago
@johanneswuerbach Yes, I think so, too.
I tried os.Chown(os.Args[0], 0, 0)
on PreCreateCheck()
, but does not work.
Maybe caused by first run command user to has not root
permission.
I think, the uid
check insert to PreCreateCheck()
e.g. (example code. too dirty.)
// Print driver version, Check VirtualBox version
func (d *Driver) PreCreateCheck() error {
.
.
.
bin, err := os.Stat(os.Args[0])
if err != nil {
return err
}
if int(bin.Sys().(*syscall.Stat_t).Uid) == 501 {
log.Infof("docker-machine-driver-xhyve need root owner. See https://github.com/zchee/docker-machine-driver-xhyve#install")
os.Exit(1)
}
return nil
}
What do you think?
Yep, exactly like this :+1:
@johanneswuerbach :) If has been merged PR on homebrew, I will add this method. and, Bump version v0.2.2 to later.
@johanneswuerbach I created a pull-request :) https://github.com/zchee/docker-machine-driver-xhyve/pull/75
Merged https://github.com/zchee/docker-machine-driver-xhyve/commit/278eb5a18af59264ddc5dd0492f78d853beae293.
If you find a bug, Could you tell me? and, I will increase the more test for the future.
Close.
this is really annoying. I still have this issue on mac os 10.11.4
Currently users running
docker-machine create -d xhyve test
without root are receiving an ugly error messageError creating machine: Error in driver during machine creation: exit status 1
Instead this driver should print a nice warning and tell the users that root is required.