Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting vagrant every time the macOS startup using 'vagrant up' command #308

Closed
kofm77 opened this issue Oct 23, 2016 · 14 comments
Closed

Comments

@kofm77
Copy link
Contributor

kofm77 commented Oct 23, 2016

I have been trying Bell in the last days, but unfortunately sometimes I get bored of repeating the same commands every time I startup my computer to start vagrant.
That's why I created a way to start vagrant automatically each time we startup our computers for less headaches, and I believe it's the simplest way:

1-Look for Automator

capture d ecran 2016-10-23 a 11 34 41 am

2-Select "Run AppleScript"

capture d ecran 2016-10-23 a 11 35 43 am

3-copy and past this code ( you have to put your own path 'directory to Vargant' )

on run {input, parameters}
tell application "Terminal"
activate
do script with command "cd /Your/vagrant/vm/directory && vagrant up && vagrant ssh"
end tell
end run
capture d ecran 2016-10-23 a 11 40 40 am

4-Go to your Account Settings

capture d ecran 2016-10-23 a 12 09 14 pm

5-Add the new application that you made with Automator Here

capture d ecran 2016-10-23 a 12 10 01 pm

Best regards

Oussem Ksontini
@kofm77 kofm77 changed the title starting vagrant every time the macOS using 'vagrant up' command starting vagrant every time the macOS startup using 'vagrant up' command Oct 23, 2016
@aberdean
Copy link
Member

I like this, @kofm77. You should do a pull request to insert it into the steps. Perhaps, you could post these instructions in the FAQ page and then post a link to them in the appropriate place in the steps.

@mepda
Copy link
Contributor

mepda commented Oct 26, 2016

could something like this also be accomplished for Windows with a batch command file?

@kofm77
Copy link
Contributor Author

kofm77 commented Oct 26, 2016

I will check that possibility for you, dear friend. Very soon :D

@aberdean
Copy link
Member

@mepda @kofm77 It's already done for Windows! ;-)

@kofm77 you can still do a pull request to add it to the FAQ page for Mac users.

@kofm77
Copy link
Contributor Author

kofm77 commented Nov 10, 2016

Dear @aberdean,
I have done a pull request few days ago, but I didn't receive any message or confirmation, showing that mu pull is accepted. Did I make a mistake?

Thank you :)

@aberdean
Copy link
Member

@kofm77 I thought you knew that when you do a pull request, you should post it in the chat, right? ;-)
Now that I saw it, I commented on it. Please, have a look.

@waryhermit
Copy link
Member

@aberdean It looks like @kofm77 modified his pull request after your comment. Have you looked at it since?

@waryhermit
Copy link
Member

Anyone else can add information on how to have vagrant automatically start on OSX or Ubuntu. A quick look on google should give you enough information.

@dogi
Copy link
Member

dogi commented Jan 20, 2017

@hikaruit15 knows a way ;)

@hikaruit15
Copy link
Contributor

Hi @waryhermit,

  • When we use vagrant up, it means we want to start the virtual machine that host our Bell App.
    From that, we could access to Bell App from browser.
  • Our question now is how to start automatically a machine on Virtualbox every time macosx startup.
    But because virtual machines don't share between accounts on Mac, so we only start automatically a machine for each user. It means when a user login.
  • To do that:
    • Download this file: virtualboxboot. Find community and change it into your machine name that you want to start automatically.
    • Copy this file into /Users/${USER}/Library/LaunchAgents/. (Note: ${USER} is your username. If you cannot find LaunchAgents directory, let create it.)
    • Reset computer to test. Done.

@waryhermit
Copy link
Member

@hikaruit15 You like that method better then the one put forward by @kofm77 ? I think his method does not require any download. But I am not a OSX user, so that is why I want someone else to do this one :)

@hikaruit15
Copy link
Contributor

@waryhermit Basically you don't need to download. That is a link to a file on my github account. I just make your step easier.
You could do it by your self by creating a new file and copy this text:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.ole.virtualboxboot.plist</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/VBoxManage</string>
    <string>startvm</string>
    <string>community</string>
    <string>--type</string>
    <string>headless</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

@waryhermit
Copy link
Member

@hikaruit15 Oh, I see. Now we just need some new intern to add this in a pull request then.

@hikaruit15
Copy link
Contributor

hikaruit15 commented Jan 21, 2017

Remmber: com.ole.virtualboxboot.plist is your file name. You could set different name for the file but it has to be the same inside the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants