[SOLVED] The virtual machine has terminated unexpectedly during startup because of signal 6
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The virtual machine has terminated unexpectedly during startup because of signal 6
I am attempting to shutdown, backup and restart a VirtualBox virtual machine. The restart command is the usual:
Code:
$ VBoxManage startvm vname
When I run this from a cron job the start fails with the message:
Code:
VBoxManage: error: The virtual machine 'WIN7VM' has terminated unexpectedly during startup because of signal 6
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
When the cron job runs, the user is currently logged onto KDE (i.e. a GUI exists for this user). If the user open a Konsole and runs the same command, it works, but doesn't work in that user's crontab.
I've posted this on the virtualbox.org forum and they are suggesting I post this here as they feel this is more Linux related than VirtualBox related.
Any idea why I can run this from KDE/Konsole/command line, but not from cron?
Any idea why I can run this from KDE/Konsole/command line, but not from cron?
Environment variables?
DISPLAY
VBOX_USER_HOME
Possibly:
VBOX_PROGRAM_PATH
Try prefixing the cron job with DISPLAY=0:.0 VBOX_USER_HOME=${Default Machine Folder}? Default Machine Folder is defined in the VirtualBox GUI Preferences.
upnort: I'll try the suggested environment variables. None of the VBOX_ variable seen to exist. DISPLAY, yes. I've already tried setting the cron path to be the same as the login path.
55020: But if I start headless, the logged in user cannot see the VM, right? Perhaps upnort's suggested DISPLAY=0:.0 will work ...
But if I start headless, the logged in user cannot see the VM, right? Perhaps upnort's suggested DISPLAY=0:.0 will work ...
True, but there are ways to access a headless system. One way is configure the system with SSH. Or, if the VM does not run X, use something like TigerVNC. Similar to TigerVNC, another way is use the VirtualBox built-in Remote Display support (VirtualBox GUI->Display->Remote Display). After enabling, use the rdesktop command (part of the stock Slackware) to view the VM console. For example, rdesktop -N ${hostname|ip address}:3389.
For VMs I trust I tend to use Bridge mode and configure the VM as part of the LAN. SSH works great with that. I have another system that I used to run headless and I used the rdesktop trick to access the VM console. The VirtualBox Remote Display support works with normal VMs too and not just headless.
With respect to the original post, I suspect mising environment variables. When I have seen that in the past, from a terminal window running in X I dump `env | sort` to a text file. Then in the cron job I configure something to dump the same results. Then compare to find the missing variables. I am sure the missing DISPLAY is part of the problem and the missing VBOX variables could be too. Usually the VBOX variables don't matter if using the standard VirtualBox install directories. Another possible missing variable with the cron job might be $HOME.
It works. Putting "DISPLAY=:0" in the actual backupVM script does not work.
Yes, I do use bridge mode and the VMs are part of the LAN. To log into the VM from a remote Windows workstation, I just use Remote Desktop Connection. I've not had the need to connect to the VM from Linux so I haven't used rdesktop. As far as the user on the Linux workstation running rdesktop, that is still an additional step versus the VM just being there when she gets into the office.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.