nix-community / nixops-vbox

NixOps VirtualBox backend [maintainer=@AmineChikhaoui]
GNU Lesser General Public License v3.0
22 stars 15 forks source link

nixops based virtualbox machine fails to deploy due to VERR_FILE_NOT_FOUND #21

Open basvandijk opened 9 years ago

basvandijk commented 9 years ago

I'm trying to deploy a nixops network where myMachine should be deployed to a virtualbox VM: deployment.targetEnv = "virtualbox";

However I'm getting the following error:

$ nixops deploy -d my-network -I ..                                                                  [master] 
myMachine> creating VirtualBox VM...
myMachine> Virtual machine 'nixops-e299e202-7c41-11e4-9674-08002734fdef-myMachine' is created and registered.
myMachine> UUID: 67f7f03a-114e-41ef-8927-9e3983ff8bba
myMachine> Settings file: '/home/bas.van.dijk/VirtualBox VMs/nixops-e299e202-7c41-11e4-9674-08002734fdef-myMachine/nixops-e299e202-7c41-11e4-9674-08002734fdef-myMachine.vbox'
myMachine> creating disk ‘disk1’...
myMachine> these derivations will be built:
myMachine>   /nix/store/c5jny1wz14wlaimbfrmmmvz0z9iysqh7-virtualbox-nixops-13.10.35433.4721802.vdi.drv
myMachine> building path(s) `/nix/store/24i6jbkg83pdndf6w6z9axmp9v2scwrp-virtualbox-nixops-13.10.35433.4721802.vdi'
myMachine> building /nix/store/24i6jbkg83pdndf6w6z9axmp9v2scwrp-virtualbox-nixops-13.10.35433.4721802.vdi
myMachine> 
myMachine> 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
myMachine> Clone hard disk created in format 'VDI'. UUID: 58fff3fc-0057-4b91-ac2a-d5e7f330cd99
myMachine> attaching disk ‘disk1’...
myMachine> VBoxManage: error: Could not launch a process for the machine 'nixops-e299e202-7c41-11e4-9674-08002734fdef-myMachine' (VERR_FILE_NOT_FOUND)
myMachine> VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component Machine, interface IMachine, callee nsISupports
myMachine> VBoxManage: error: Context: "LaunchVMProcess(a->session, sessionType.raw(), env.raw(), progress.asOutParam())" at line 592 of file VBoxManageMisc.cpp
error: command ‘['VBoxManage', 'startvm', u'nixops-e299e202-7c41-11e4-9674-08002734fdef-myMachine']’ failed on machine ‘myMachine’ (exit code 1

Note that the -I .. points to a nixpkgs with a recent checkout of nixpkgs master.

Any idea what I'm doing wrong?

sjmackenzie commented 9 years ago

Yes I'm also getting the issue, even on 4b53c3d03b5af73122307383ae1c22146ae302c4

$ nixops deploy -d 894a3787-2ef9-11e5-8f06-56847afe9799
webserver> creating VirtualBox VM...
webserver> Virtual machine 'nixops-894a3787-2ef9-11e5-8f06-56847afe9799-webserver' is created and registered.
webserver> UUID: de026fd2-0f98-4745-b255-57ab19702002
webserver> Settings file: '/home/stewart/VirtualBox VMs/nixops-894a3787-2ef9-11e5-8f06-56847afe9799-webserver/nixops-894a3787-2ef9-11e5-8f06-56847afe9799-webserver.vbox'
webserver> creating disk ‘disk1’...
webserver> 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
webserver> Clone hard disk created in format 'VDI'. UUID: 827d793b-e185-4200-a875-290670fb1491
webserver> attaching disk ‘disk1’...
webserver> Waiting for VM "nixops-894a3787-2ef9-11e5-8f06-56847afe9799-webserver" to power on...
webserver> VM "nixops-894a3787-2ef9-11e5-8f06-56847afe9799-webserver" has been successfully started.
error: command ‘['VBoxManage', 'startvm', u'nixops-894a3787-2ef9-11e5-8f06-56847afe9799-webserver']’ failed on machine ‘webserver’ (exit code 1)
manveru commented 9 years ago

Anyone know a solution for this?

coreyoconnor commented 9 years ago

I'm able to reproduce the same failure as above outside of nixops. The failure mode I'm experiencing is not specific to nixops.

This is the error when run under nixops:

single> Waiting for VM "nixops-9986315c-90a3-11e5-8152-7b4b0cb998fb-single" to power on...
single> VM "nixops-9986315c-90a3-11e5-8152-7b4b0cb998fb-single" has been successfully started.
error: command ‘['VBoxManage', 'startvm', u'nixops-9986315c-90a3-11e5-8152-7b4b0cb998fb-single', '--type', 'headless']’ failed on machine ‘single’ (exit code 1)
Build step 'Execute shell' marked build as failure

same failure when run outside of nixops in the same environment:

+ VBoxManage startvm nixops-7f2d9d02-90aa-11e5-9840-f39eed29cbf9-single --type headless
Waiting for VM "nixops-7f2d9d02-90aa-11e5-9840-f39eed29cbf9-single" to power on...
VM "nixops-7f2d9d02-90aa-11e5-9840-f39eed29cbf9-single" has been successfully started.
Build step 'Execute shell' marked build as failure

The failure only occurs, and occurs 100% of the time, if the command is executed under jenkins continuous integration service. If the command is not executed under the service the command succeeds without error.

I've confirmed all required kernel extensions are installed and usable. The user jenkins executes under, jenkins, is a member of the vboxusers group. The presence or absence of DISPLAY has no effect. The command will succeed when run manually in a shell that is set up as close as possible to the jenkins execution environment. Same user, same environment variables, same shell. The only difference I can determine is one is under a systemd service; the other is via an interactive shell (no DISPLAY in either).

I have no idea what is specific about execution under systemd that would result in this very unhelpful error.

Changing the virtualbox logging has no effect: No logging is attempted prior to the failure.

Weird eh?

solomon-b commented 3 years ago

is there a known solution for this issue?

thalesmg commented 3 years ago

I'm facing a similar problem trying to run a "hello world" nixops deploy. But I'm running Nix not on a NixOS system (using archlinux).