1

I have a virtual machine in EXSI 6.5 and install Ubuntu on that. I write a bash file to run a command in start up as bellow:

#!/bin/bash

# Bash script to dvblast

sleep 10

gnome-terminal --title="foo" -x bash -c \
"printf '\e[8;13;90t'&&dvblast -a 3 -f 12596000 -s 27500000 -v 13 -c Tuner4.cfg -i 1; read line" &

Its run DVBLast in start up with first 10 second sleep. This bash file work fine.

But when I export ovf template from this VM and deploy again to Esxi and start vm, the bash file failed to run by Permission denied. this is output window image:

output

When I run the command with strace see this log:

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
DVBlast 2.2 (release)
warning: restarting
open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
open("/usr/lib/x86_64-linux-gnu/gconv/ISO8859-1.so", O_RDONLY|O_CLOEXEC) = 3
debug: using linux-dvb API version 5
open("/dev/dvb/adapter3/frontend0", O_RDWR|O_NONBLOCK) = -1 ENOENT (No such file or directory)
error: opening device /dev/dvb/adapter3/frontend0 failed (No such file or directory)
+++ exited with 1 +++

If I run terminal and run sudo -s and then run the bash file its work fine.

Anybody know how I solve this problem? Thanks in advance

Ali
  • 93

1 Answers1

1

As simlev has pointed out the error is actually about the problem reaching the DVB device. When exporting the OVF and importing again on another host the configuration of VM might have omitted the DVB tuner, or it could simply be non-existant on the other machine. Check the configuration of the copied Virtual Machine and make sure that the DVB device is passed through exactly as in the source Virtual Machine.

Then log in to the cloned VM, and check if the udev rules did not reserve the name of the DVB device from the first esxi, or the tuner on the new VM has another device address like /dev/dvb/adapter4/frontend0 instead of /dev/dvb/adapter3/frontend0, or perhaps the frontend must be altered (not the same INPUT on the tuner for example, or a different make/model of hardware)

I believe it is the problem in addressing the device rather than anything related to BASH itself.

bocian85
  • 411