start .sh script on ubuntu through Vbox

Discussions related to using VirtualBox on Windows hosts.
Post Reply
ros88
Posts: 6
Joined: 22. Oct 2015, 14:26

start .sh script on ubuntu through Vbox

Post by ros88 »

Hello
I have Ubuntu installed on virtual box, and i need to run a script that stored at ubuntu.

The proccess should be like this :
In windows open .bat script that will start virual machine , load ubuntu and execute the script at the location: /home/user/Documents/myscipt.sh after that ubuntu will shut down.
I read u user manual and tried to use with VBoxManage.exe but i believe that i missing something because it does not work.

what i am doing wrong?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: start .sh script on ubuntu through Vbox

Post by scottgus1 »

start virual machine , load ubuntu and execute the script
Does Ubuntu have a "Startup" folder like Windows has? You could put the program/script you need to run when Ubuntu boots in whatever Ubuntu has for running programs when the OS boots. Have the script handle the running of the Ubuntu process & shutdown. Then all your host script needs to do is start the guest.
ros88
Posts: 6
Joined: 22. Oct 2015, 14:26

Re: start .sh script on ubuntu through Vbox

Post by ros88 »

I have several scripts that i need to run , so i dont want to put the .sh script on the start up of the ubuntu.
Maybe there is a way to control guest ubuntu terminal ?
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: start .sh script on ubuntu through Vbox

Post by loukingjr »

I don't believe there is any way to control a guest's terminal from the host or VirtualBox.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: start .sh script on ubuntu through Vbox

Post by scottgus1 »

Gotcha. Different scripts on demand, OK. Show us the command you used and what error message you get.
liamblack
Posts: 8
Joined: 22. Oct 2015, 04:57

Re: start .sh script on ubuntu through Vbox

Post by liamblack »

You could ssh into the ubuntu box.
Post Reply