[HOWTO] start and stop VM with your NAS.

Just about everything is virtual these days. Topics relating to virutalization go here.

Moderator: Lillian.W@AST

sksbir
Posts: 395
youtube meble na wymiar Warszawa
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Post by sksbir »

Hi
I have tested the same part of your script on my server, VBoxManage works has expected, thus log is almost the same has yours ( I have the funny bug 'flase' in script too ), only the DEFAULT_AVOUTPUT is equal to HDMI1 on my server.

Code: Select all

+ PKG_PATH=/usr/local/AppCentral/virtualbox
+ VM_NAME=grenouille
+ source /usr/local/AppCentral/virtualbox/CONTROL/env.sh
+ XORG_PATH=/usr/local/AppCentral/xorg
+ [ ! -e /usr/local/AppCentral/xorg/CONTROL/env.sh ]
+ source /usr/local/AppCentral/xorg/CONTROL/env.sh
+ PKG_PATH=/usr/local/AppCentral/xorg
+ export XORG_BIN_PATH=/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec
+ export XORG_LD_LIBRARY_PATH=/usr/local/AppCentral/xorg/lib:/usr/local/AppCentral/xorg/usr/lib
+ export PATH=/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec:/bin:/sbin:/usr/bin:/usr/sbin:/usr/builtin/bin:/usr/builtin/sbin:/usr/local/bin:/usr/local/sbin
+ export LD_LIBRARY_PATH=/usr/local/AppCentral/xorg/lib:/usr/local/AppCentral/xorg/usr/lib:/usr/lib64:/usr/lib
+ export PYTHONPATH=:/usr/local/AppCentral/xorg/usr/lib/python2.7/site-packages
+ export DISPLAY=:0
+ export XCURSOR_THEME=whiteglass
+ export XCURSOR_SIZE=48
+ export LD_PRELOAD=/usr/lib/preloadable_libiconv.so
+ export DEFAULT_AVOUTPUT=HDMI1
+ export EDID_PATH=/sys/class/drm/card0-HDMI-A-1/edid
+ DEBUG=flase
+ [ true == flase ]
+ PKG_PATH=/usr/local/AppCentral/virtualbox
+ export VIRTUALBOX_BIN_PATH=/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec
+ export PATH=/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec:/bin:/sbin:/usr/bin:/usr/sbin:/usr/builtin/bin:/usr/builtin/sbin:/usr/local/bin:/usr/local/sbin
+ export VIRTUALBOX_LD_LIBRARY_PATH=/usr/local/AppCentral/virtualbox/lib:/usr/local/AppCentral/xorg/lib:/usr/local/AppCentral/xorg/usr/lib
+ export LD_LIBRARY_PATH=/usr/local/AppCentral/virtualbox/lib:/usr/local/AppCentral/xorg/lib:/usr/local/AppCentral/xorg/usr/lib:/usr/lib64:/usr/lib
+ export DISPLAY=:0
+ DEBUG=flase
+ [ true == flase ]
+ . /lib/lsb/init-functions
+ FANCYTTY=
+ [ -e /etc/lsb-base-logging.sh ]
+ true
+ VBoxManage list vms
"<inaccessible>" {d6342754-a55f-4548-bb8a-a8adf1ab0b56}
"<inaccessible>" {f29edb67-44e8-4410-a292-f101467fa97c}
"<inaccessible>" {3b9bb93d-5e86-495c-b635-2b792d8462a5}
+ VBoxManage list runningvms
+ exit 0
- Did you have installed this APPs : media-pack, xorg, virtualbox extension ?
- none of this APP are disabled ? ( they are all enabled ? )
- are all your APPs at the last level of update ? ( APP central --> installed APP --> refresh list , APP central --> all APP --> refresh , APP Central --> update)

sksbir wrote:....
Out of that, vboxmanage command should work directly once connected to your NAS with ssh ( in my memory )...
I was wrong : VBoxManage don't work directly , is not in the path of a logged shell. You must use it in the script.
docb
Posts: 30
Joined: Sat Sep 09, 2017 1:34 am

Re: [HOWTO] start and stop VM with your NAS.

Post by docb »

Yes, all apps are installed, active and up to date:
Adm 3.0.1R9J2
Media-pack 2.7.0r01
Xorg 10.14.7.R31
Virtualbox 5.1.14.r01
Virtualbox extensions 5.1.14.r01
Does VBoxManager run when you type it into the ssh prompt?
sksbir
Posts: 395
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Post by sksbir »

no.
docb wrote:Hi,.....By the way: I cannot open phpVirtualbox (the Virtualbox App on ADM Desktop). It only opens a tab which closes within miliseconds. The only way to set up Virtualbox is via the HDMI-Portal App. I have a different topic in this forum regarding this error, but just in case that problem could interfere with this here.
Could not find your other topic.
You must enable web server in "services", either with or without ssl, and enable php cache : virtualbox is part of webserver, with ./virtualbox subaddress :

something like http(s)://yourwebserver:yourport/virtualbox

Maybe it's needed to get VBoxManage working...
docb
Posts: 30
Joined: Sat Sep 09, 2017 1:34 am

Re: [HOWTO] start and stop VM with your NAS.

Post by docb »

Hi,
the other topic was viewtopic.php?f=124&t=9142&p=29542#p29542, I allready posted your solution there. Thank you very much, now phpVirutalbox runs like a charm ;-)
On the other hand, the script still does not work (with the same error) and also ssh promt vboxmanage results in a "-sh: vboxmanage not found". I think that is the reason why the script doesn't work. If you ssh promt vboxmanage, does that work on your NAS?
When I start VBoxManage from the directory where it is in, I get the same error as when I start it from the script:

Code: Select all

admin@AS:/volume1/.@plugins/AppCentral/virtualbox/bin $ ./VBoxManage
./VBoxManage: error while loading shared libraries: VBoxDDU.so: cannot open shared object file: No such file or directory
admin@AS:/volume1/.@plugins/AppCentral/virtualbox/bin $
sksbir
Posts: 395
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Post by sksbir »

hello
edit your script
- move the 'set +x' line forward, just after ". /lib/lsb/init-functions" ( because we have seen that environment is loaded in the same manner, so no longer need to get verbose output about this section )
- add this 2 lines near the VBoxManage order:

Code: Select all

which VBoxDDU.so
set | grep '/usr/local/AppCentral/virtualbox/bin'
Here is now how script running looks like on my NAS:

Code: Select all

+ which VBoxDDU.so
/usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
+ set
+ grep /usr/local/AppCentral/virtualbox/bin
PATH='/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec:/bin:/sbin:/usr/bin:/usr/sbin:/usr/builtin/bin:/usr/builtin/sbin:/usr/local/bin:/usr/local/sbin'
VIRTUALBOX_BIN_PATH='/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec'
+ VBoxManage list vms
"crapaud" {f29edb67-44e8-4410-a292-f101467fa97c}
"grenouille" {d6342754-a55f-4548-bb8a-a8adf1ab0b56}
"nenuphar" {3b9bb93d-5e86-495c-b635-2b792d8462a5}
+ VBoxManage list runningvms
If the answer about VBoxDDU.so is different that "/usr/local/AppCentral/virtualbox/bin/VBoxDDU.so"( not found, or nothing is answered ), from ssh prompt type in :

Code: Select all

ls -l /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
in order to see if this shared library object is there or not.

The script should also answers a line with the PATH and VIRTUALBOX_BIN_PATH value.

Code: Select all

PATH='/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec:/bin:/sbin:/usr/bin:/usr/sbin:/usr/builtin/bin:/usr/builtin/sbin:/usr/local/bin:/usr/local/sbin'
VIRTUALBOX_BIN_PATH='/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec'
Main thing is that /usr/local/AppCentral/virtualbox/bin is included.

docb wrote:... If you ssh promt vboxmanage, does that work on your NAS?....
Has said before : I was wrong with that. VBoxmanage is not in the path by default.
Out of that, take care of letter case ( vboxmanage <> VBoxManage , and ./VBoxManage will never work )
docb
Posts: 30
Joined: Sat Sep 09, 2017 1:34 am

Re: [HOWTO] start and stop VM with your NAS.

Post by docb »

Hm. Really mysterious.
I changed the script as you described it:

Code: Select all

#!/bin/sh
PKG_PATH=/usr/local/AppCentral/virtualbox
VM_NAME="UbuntuServer"
source $PKG_PATH/CONTROL/env.sh
. /lib/lsb/init-functions
set -x
which VBoxDDU.so
set | grep '/usr/local/AppCentral/virtualbox/bin'
VBoxManage list runningvms
But I again get the "error while loading shared libraries: VBoxDDU.so: cannot open shared object file: No such file or directory.

Code: Select all

admin@AS:/volume1/Download/scripts $ ./VM_UbuntuServer_test.sh
+ which VBoxDDU.so
/usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
+ set
+ grep /usr/local/AppCentral/virtualbox/bin
PATH='/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec:/bin:/sbin:/usr/bin:/usr/sbin:/usr/builtin/bin:/usr/builtin/sbin:/usr/local/bin:/usr/local/sbin'
VIRTUALBOX_BIN_PATH='/usr/local/AppCentral/virtualbox/bin:/usr/local/AppCentral/xorg/bin:/usr/local/AppCentral/xorg/usr/bin:/usr/local/AppCentral/xorg/usr/sbin:/usr/local/AppCentral/xorg/sbin:/usr/local/AppCentral/xorg/usr/libexec'
+ VBoxManage list runningvms
VBoxManage: error while loading shared libraries: VBoxDDU.so: cannot open shared object file: No such file or directory
Even if I change the line "VBoxManage list runningvms" to "VBoxManage list vms" as you did, I get the same result.
sksbir
Posts: 395
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Post by sksbir »

Okkk

1/ just because I'm curious about your problem: from ssh

Code: Select all

# ls -l /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
-rwxr-xr-x    1 root     root        368736 Jan 16  2017 /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so*

# md5sum /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
2ddf1cb919a6575dd042cb374664af2b  /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
Result should be the same on your NAS.

If the result is not the same, you have to reinstall. If the result is the same, I have no more idea out of trying to reinstall...

So , re-installation :
2/ from APPcentral
-> remove ( not only disable ) VirtualBox, VirtualBox extension, media-pack.
-> reinstall

if your Virtualbox configuration is lost ( that is, you no longer see your VM ) , its quite easy to add existing VM from phpvirtualbox interface : right clic --> add existing --> locate where your '.vbox' file defining your VM is stored.
docb
Posts: 30
Joined: Sat Sep 09, 2017 1:34 am

Re: [HOWTO] start and stop VM with your NAS.

Post by docb »

Yes, the result is exactly the same:

Code: Select all

admin@AS:/volume1/home/admin $ ls -l /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
-rwxr-xr-x    1 root     root        368736 Jan 16  2017 /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so*
admin@AS:/volume1/home/admin $ md5sum /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
2ddf1cb919a6575dd042cb374664af2b  /usr/local/AppCentral/virtualbox/bin/VBoxDDU.so
admin@AS:/volume1/home/admin $
I just tried VBoxManage from the promt - the same error:

Code: Select all

admin@AS:/volume1/.@plugins/AppCentral/virtualbox/bin $ ./VBoxManage
./VBoxManage: error while loading shared libraries: VBoxDDU.so: cannot open shared object file: No such file or directory
docb
Posts: 30
Joined: Sat Sep 09, 2017 1:34 am

Re: [HOWTO] start and stop VM with your NAS.

Post by docb »

Hm. I searched the whole internet but found no solution. I deactivated audio just to give it a try. But nothing helps. Maybe it has something to do with the VB extention? I just installed the App via ADM, do I need to do something else with it, like run something on ssh promt?
docb
Posts: 30
Joined: Sat Sep 09, 2017 1:34 am

Re: [HOWTO] start and stop VM with your NAS.

Post by docb »

Well with some more web-searching, I managed to install the extentions on the Ubuntu VM. But nothing changed. Another websearch led me to a

Code: Select all

sudo /sbin/ldconfig -v
but that also did not change the error:

Code: Select all

admin@AS:/volume1/.@plugins/AppCentral/virtualbox/bin $ ./VBoxManage
./VBoxManage: error while loading shared libraries: VBoxDDU.so: cannot open shared object file: No such file or directory
Now I even reinstalled VirtualBox and the Extention... that did not help as well. :cry:
Post Reply

Return to “Virtualization”