How to install Guest addition in Mac OS as guest and Windows machine as host - virtual-machine

I am trying to copy contents from my host machine to a guest machine, but for copying I need to install the Guest additions disk.
Or there is there another way to access host machine content on the guest machine or vice-versa?

Guest Additions are available for MacOS starting with VirtualBox 6.0.
Installing:
Boot & login into your guest macOS.
In VirtualBox UI, use menu Devices | Insert Guest Additions CD image...
CD will appear on your macOS desktop, open it.
Run VBoxDarwinAdditions.pkg.
Go through installer, it's mostly about clicking Next.
At some step, macOS will be asking about permissions for Oracle. Click the button to go to System Preferences and allow it.
If you forgot/misclicked in step 6, go to macOS System Preferences | Security & Privacy | General. In the bottom, there will be a question to allow permissions for Oracle. Allow it.
Troubleshooting
macOS 10.15 introduced new code signing requirements; Guest additions installation will fail. However, if you reboot and apply step 7 from list above, shared clipboard will still work.
VirtualBox < 6.0.12 has a bug where Guest Additions service doesn't start. Use newer VirtualBox.

In the guest Mac, open the Terminal and go for a reboot on the Recovery partition
sudo nvram "recovery-boot-mode=unused"
sudo reboot
Now you're in Recovery mode, enter the Terminal and do:
csrutil disable
spctl kext-consent add VB5E2TV963
nvram -d recovery-boot-mode
reboot
Back in "normal" mode, open the Terminal, and do:
sudo mount -uw /
sudo chown :admin /System/Library/Extensions/
sudo chmod 775 /System/Library/Extensions/
Run the Guest Additions installer and go through the end
(in principle, it goes through successfully)
Now in the terminal, do:
sudo chown :wheel /System/Library/Extensions/
sudo chmod 755 /System/Library/Extensions/
sudo nvram "recovery-boot-mode=unused"
sudo reboot
Again in Recovery mode, go into the Terminal and do:
csrutil enable
nvram -d recovery-boot-mode
reboot
You should be set.

Guest additions are not available for Mac OS X. You can get features like clipboard sync and shared folders by using VNC and SMB. Here's my answer on a similar question.

You can use SSH and SFTP as suggested here.
In the Guest OS (Mac OS X), open System Preferences > Sharing, then activate Remote Login; note the ip address specified in the Remote Login instructions, e.g. ssh user#10.0.2.15
In VirtualBox, open Devices > Network > Network Settings > Advanced > Port Forwarding and specify Host IP = 127.0.0.1, Host Port 2222, Guest IP 10.0.2.15, Guest Port 22
On the Host OS, run the following command sftp -P 2222 user#127.0.0.1; if you prefer a graphical interface, you can use FileZilla
Replace user and 10.0.2.15 with the appropriate values relevant to your configuration.

I've the same problem, and by the "trial and error" method I have the steps to install the guest additions on a MacOS guest:
insert the guest additions cd
open the cd on file manager
double click on VBoxDarwinAdditions.pkg
the installer opens, then click contine
next screen to set location of installed files, only press install
your password can be asked a couple of time while installing, write
it and continue
this is the tricky part, on my installation, macos show an message
about the driver created by oracle won't be installed because a
security issue, it has the option to enable it, so click on the
button to open security screen and click on the allow button next to
the oracle software listed at bottom of the security settings
window, it will ask your password again. Meanwhile the pkg installer
continued as if it has permissions and will say "install finished",
but I don't believe it so, once I unlocked the oracle drivers
installations I repeat the whole process from step 3, and in the
second round all installs without asking more than the first
password to install.
And it is done!

Above, someone gave a hint:
At some step, macOS will be asking about permissions for Oracle. Click the button to go to System Preferences and allow it.
If you forgot/misclicked in step 6, go to macOS System Preferences | Security & Privacy | General. In the bottom, there will be a question to allow permissions for Oracle. Allow it.
It took me a couple of hours but I did finally find what he was talking about - it's actually in the bottom of the Mac - click on the gear icon and you'll find it eventually.

You need to update your virtualbox sw. On new version, there is VBoxDarwinAdditions.pkg included in a additions iso image, in older versions is missing.

you can do it from the windows 10 terminal
step 1: open CMD in administrator mode
step 2 paste this open CMD cd "C:\Program Files\Oracle\Virtualbox"
step 3: paste this command in the open CMD, you must indicate the name you have in VirtualBox
VBoxManage setextradata "Virtual machine name" VBoxInternal2/EfiGraphicsResolution X
Example:
VBoxManage setextradata "Mac OS Sierra" VBoxInternal2/EfiGraphicsResolution 1280x720

Before you start, close VirtualBox!
After those manipulations start VB as Administrator!
Run CMD as Administrator
Use lines below one by one:
cd "C:\Program Files\Oracle\Virtualbox"
VBoxManage setextradata “macOS_Catalina” VBoxInternal2/EfiGraphicsResolution 1920x1080
Screen Resolutions: 1280x720, 1920x1080, 2048x1080, 2560x1440, 3840x2160, 1280x800, 1280x1024, 1440x900, 1600x900
Description:
macOS_Catalina - insert your VB machine name.
1920x1080 - put here your Screen Resolution.
Cheers!

Have you tried https://www.virtualbox.org/manual/ch04.html which has step-by-step instructions to help you?
Make your VM bi-directional for Clipboard and Drag & Drop
Share folders from your host to the guest VM too.

Related

Booting raw-disk windows 10 vm in virtualbox boots to grub shell

I have a dual-boot setup with Windows 10 and Kubuntu 18. Following instructions found from here and there I managed to get the Windows to run as guest in Kubuntu host as a VM using VirtualBox.
sudo usermod -a -G disk $USER
VBoxManage internalcommands createrawvmdk -filename "/path/to/vm/win10.vmdk" -rawdisk /dev/sda -partitions 1,3,4 -relative
The first line is to avoid running VirtualBox as superuser.
When I boot the VM, I briefly see an error message
Boot Failed. EFI DVD/CDROM
SystemBootOrder not found. Initializing defaults.
Creating boot entry "Boot0003" with label "ubuntu" for file "\EFI\ubuntu\shimx64.efi"
and then end up in grub shell. Now, when I run the commands
insmod chain
set root=(hd0,gpt1)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
Windows boots and works just fine but entering these every time is not exactly smooth workflow. Any idea how to permanently fix this?
Please note that I'd still like to be able to physically boot into both OS's.
Thanks,
I had the same problem. I fixed it, but then updated my kernel and so grub re-un-fixed it for me! Figuring it out for the second time was quicker, but I figured it'd be even quicker next time to find my answer on StackOverflow!
My grub.cfg file in /boot/efi/EFI/ubuntu looked like this:
search.fs_uuid 47d6233f-c0ae-4f89-bf18-184452eac803 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Because we have setup the VirtualBox vmdk file with only the selected partitions for Windows to work, the search.fs_uuid command was failing, $root was empty and so grub can't find $prefix/grub.cfg (/boot/grub/grub.cfg in my linux rootfs which is on sda6==gpt6)
I automated it by changing the EFI grub.cfg, note my EFI System partition is 2 not 1 as in your example:
search.fs_uuid 47d6233f-c0ae-4f89-bf18-184452eac803 root hd0,gpt6
set prefix=($root)'/boot/grub'
if [ -f $prefix/grub.cfg ]
then
configfile $prefix/grub.cfg
else
insmod chain
set root=(hd0,gpt2)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
fi
Now if grub can find the cfg file it will give me the menu to select the boot as before, but if it can't - when I'm in VirtualBox - it'll just boot straight into Win10.
Hope this helps!

virtualbox Raw-mode is unavailable courtesy of Hyper-V windows 10

issues:
Failed to open a session for the virtual machine ubuntu.
Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).
Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
UPDATES:
Solution is given below.
You may need to disable the hypervisor.
So, follow the next steps:
1) Open command prompt as Administrator
2) Run bcdedit to check hypervisor status:
bcdedit
3) Check hypervisor launch type:
4) If is set to auto then disable it:
bcdedit /set hypervisorlaunchtype off
5) Reboot host machine and launch VirtualBox again
Disabling Device Guard or Credential Guard fixed for me:
click Start > Run, type gpedit.msc, and click Ok. The Local Group Policy Editor opens.
Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Device Guard > Turn on Virtualization Based Security.
Select Disabled.
Go to Control Panel > Uninstall a Program > Turn Windows features on or off to turn off Hyper-V.
Select. Do not restart.
Delete the related EFI variables by launching a command prompt on the host machine using an Administrator account and run these commands:
mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d
Note: Ensure X is an unused drive, else change to another drive.
Restart the host.
Accept the prompt on the boot screen to disable Device Guard or Credential Guard.
Source: https://kb.vmware.com/s/article/2146361
disabled Hyper-V (Control Panel\Programs\Programs and Features\ Hyper-V)
modify BCD (bcdedit /set hypervisorlaunchtype off)
If core isolation is enabled, turn it off (Windows Defender Security Center> Device Security> Core Quarantine)
If you cannot modify it, you can change the value of HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ DeviceGuard \ Scenarios \ HypervisorEnforcedCode Integrity \ Enabled in the registry to 0
1) Run below command in powershell with admin mode:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
2) run below command in command prompt with admin mode:
bcdedit /set hypervisorlaunchtype off
3) disabled Hyper-V: Control Panel\Programs\Programs and Features\
4) VMBox memory made it to: 3155 MB (VMbox->settings->system)
VM box Acceleration is deactivated. How do activate this? and fix above error?
Restart your system.
To check the status of Hyper-v in Windows 10,
right click <"start"> → Run → OptionalFeatures.exe, → look for the "Hyper-V" option.
The box should be empty, not checked or shaded.
Make sure to fully power down and reboot the host after changing the Hyper-v setting.
PS
Docker known for activating this "Hyper-V" without asking for user opinion and then Oracle VirtualBox does not want to work.
Finally I can fix the issue now.
At first, we need to identify or understand the problem which mostly people not really findout, my VM is came with guest OS of Ubuntu 64-bits but after import, we check on that VM it shows only 32-bits OS.
When we start the VM, we got error as:
Failed to open a session for the virtual machine ERPNext-Develop-20180331192506.
Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).
Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
I did try above solutions, somehow not really work or I might miss something.
Then I notice the point above (32-bits OS) so I think the problem might be with this one.
With some posts around the Internet, it could explain that Windows 10 also comes with the Hyper-V which is conflict with Oracle VM VirtualBox.
So solution I did...
1. Disable Virtualization Based Security in group policy
Start Run application and start: gpedit.msc
Go to Computer configuration > Administrative Template > Device Guard
Disable Microsoft Hyper-V
Start Run application and start: OptionalFeatures.exe
Untick: Hyper-V
Restart the PC
Then we can use the VM, it's started. Among the two steps above, I believe that step 2 is really solved.
Anyway, please try it and let's know if it helps.
I wanted learn how to use vagrant with virtualbox, when I got the error message 'Raw-mode is unavailable courtesy of Hyper-V'.
To fix this issue, I think I made all of the suggested changes above (thank you guys), and some more.
Let me summarize:
( cmd: optionalfeatures )
Turn off 'Hyper-V'
Turn off 'Containers'
Turn off 'Windows Subsystem for Linux'
cmd: bcdedit /set hypervisorlaunchtype off
( cmd: gpedit.msc )
Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Device Guard ->
Disable 'Turn On Virtualization Based Security'
Settings -> Update & Security -> Windows Security -> Device Security -> Core isolation details -> Memory integrity -> Off
You need to disable the windows Hyper-V feature and bcd. Then Virtual Box will run in latest Windows 10 versions (Jan-Mar 2018). Windows 10 Hyper-V is having clash on VirtualBox features.
I have resolved this by following steps-
bcdedit /set hypervisorlaunchtype off
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Restart your windows
Detailed discussion on this are available at -
https://forums.virtualbox.org/viewtopic.php?f=6&t=87237
Alternatively you can install linux (Ubuntu) in Windows 10 from the latest bash command - https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10
For me the combination of the following three was the solution:
1.
control panel > turn windows features on or offf > Hyper-V : deselect
2.
admin cmd > bcdedit > hypervisorlaunchtype:Auto
disabling:
bcdedit /set hypervisorlaunchtype off
3.
gpedit.msc > 'Computer configuration > Administrative Template > System > Device Guard' > Turn On Virtualization Based Security :
Change from 'Not configured' to 'Disabled'
REBOOT
note: after the reboot the VirtualBox worked, but Docker Desktop's VirtualBox started complaining about missing Hyper-V !
It seems that this might have been the root of all my evil...
Extra info: https://forums.docker.com/t/running-docker-and-virtualbox-on-the-same-machine/23578/13
You have to disable Memory Integrity.
Go to Device Security, then Core Isolation, disable Memory Integrity and reboot.
It seems that Memory Integrity virtualizes some processes (in this case, VMware) and we get that error.
You can also disable Memory Integrity from Registry Editor if your control panel was saying 'This is managed by your administrator'.
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity
Double click on Enabled and change its value from 1 to 0 to disable it.
Helpful source: https://forums.virtualbox.org/viewtopic.php?t=86977#p420584
In my case, was the Docker that cause problems:
After Windows 10 update in July of 2018 I suddenly experienced this issue with Virtual Box losing 64-Bit OS options resulting in the error.
virtualbox Raw-mode is unavailable courtesy of Hyper-V windows 10
Existing Laravel Homestead Boxes rendered un-bootable as a result event though HYPER-V is Disabled / Not Installed...
The FIX! (That worked for me) Drum Roll....
Install Hyper-V... Reboot, Uninstall it again... Reboot... The end
As in the docs, if you are on windows you can use hyperv drivers.
Docker for Windows - You can use docker-machine create with the hyperv
driver to create additional local machines.
Run CMD in administrator mode
1.bcdedit
2.bcdedit /set hypervisorlaunchtype off
3.Reboot system
This worked for me!!
The latest version of virtual box 6.0 supports HyperV !
https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html
Mi helped:
windows defender settings >> device security >> core insulation (details) >> Memory integrity >> Disable (OFF)
SYSTEM RESTART !
Mi helped: windows defender settings >> device security >> core insulation (details) >> Memory integrity >> Disable (OFF) SYSTEM RESTART !
this solution is better for me
This would be the easiest way.
1) go and download the Device Guard and Credential Guard hardware readiness tool here- https://www.microsoft.com/en-us/download/details.aspx?id=53337
2) Find the folder path of "DG_Readiness_Tool_v3.5.ps1" of downloaded content and run the below command after enable Powershell "unrestricted".
"./DG_Readiness_Tool_v3.5.ps1 -Disable -AutoReboot"
3) When rebooting the machine press F3 to confirm to disable the features
In my case, the problem was with the specific box I was trying to use ubuntu/xenial64, I just had to switch to centos/7 and all those errors disappeared.
Hope this helps someone.
I have exactly the same question and have done the same things as you with no success.
I found an entries in my log of
HM: HMR3Init: Falling back to raw-mode: VT-x is not available
VMSetError: F:\tinderbox\win-5.2\src\VBox\VMM\VMMR3\VM.cpp(361) int __cdecl
VMR3Create(unsigned int,const struct VMM2USERMETHODS *,void (__cdecl *)(struct UVM *,void *,int,const char *,unsigned int,const char *,const char *,char *),void *,int (__cdecl *)(struct UVM *,struct VM *,void *),void *,struct VM **,struct UVM **); rc=VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT
00:00:05.088846
VMSetError: Raw-mode is unavailable courtesy of Hyper-V. 00:00:05.089946
ERROR [COM]: aRC=E_FAIL (0x80004005) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT)}, preserve=false aResultDetail=0 00:00:05.090271 Console: Machine state changed to 'PoweredOff'
My chip says it has VT-x and is on in the Bios but the log says not
HM: HMR3Init: Falling back to raw-mode: VT-x is not available
I have a 6 month old Lenovo Yoga with 2.7-GHz Intel Core i7-7500U
I have tried the following, but it didn't work for me.
From this thread https://forums.virtualbox.org/viewtopic.php?t=77120#p383348 I tried disabling Device Guard but Windows wouldn't shut down so I reenabled it.
I used this path ....
On the host operating system, click Start > Run, type gpedit.msc, and click Ok. The Local group Policy Editor opens.
Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Device Guard > Turn on Virtualization Based Security. Select Disabled.
i had same problem guys
virtual box was running smoothly on my windows machine but when new update came virtual started giving me this error and believe me guys just a little S%$& thing fixed it
in my case this problem fixed just by installing windows extension pack that's it

How to enable X11 forwarding in PyCharm SSH session?

The Question
I'm trying to enable X11 forwarding through the PyCharm SSH Terminal which can be executed via
"Tools -> Start SSH session..."
Unfortunately, It seems there is no way of specifying the flags like I would do in my shell for enabling the X11 Forwarding:
ssh -X user#remotehost
Do you know some clever way of achieving this?
Current dirty solution
The only dirty hack I found is to open an external ssh connection with X11 forwarding and than manually update the environment variable DISPLAY.
For example I can run on my external ssh session:
vincenzo#remotehost:$ echo $DISPLAY
localhost:10.0
And than set on my PyCharm terminal:
export DISPLAY=localhost:10.0
or update the DISPLAY variable in the Run/Debug Configuration, if I want to run the program from the GUI.
However, I really don't like this solution of using an external ssh terminal and manually update the DISPLAY variable and I'm sure there's a better way of achieving this!
Any help would be much appreciated.
P.s. Making an alias like:
alias ssh='ssh -X'
in my .bashrc doesn't force PyCharm to enable X11 forwarding.
So I was able to patch up jsch and test this out and it worked great.
Using X11 forwarding
You will need to do the following to use X11 forwarding in PyCharm:
- Install an X Server if you don't already have one. On Windows this might be the VcXsrv project, on Mac OS X the XQuartz project.
- Download or compile the jsch package. See instructions for compilation below.
- Backup jsch-0.1.54.jar in your pycharm's lib folder and replace it with the patched version. Start Pycharm with a remote environment and make sure to remove any instances of the DISPLAY environment variable you might have set in the run/debug configuration.
Compilation
Here is what you need to do on a Mac OS or Linux system with Maven installed.
wget http://sourceforge.net/projects/jsch/files/jsch/0.1.54/jsch-0.1.54.zip/download
unzip download
cd jsch-0.1.54
sed -e 's|x11_forwarding=false|x11_forwarding=true|g' -e 's|xforwading=false|xforwading=true|g' -i src/main/java/com/jcraft/jsch/*.java
sed -e 's|<version>0.1.53</version>|<version>0.1.54</version>|g' -i pom.xml
mvn clean package
This will create jsch-0.1.54.jar in target folder.
Update 2020:
I found a very easy solution. It may be due to the updated PyCharm version (2020.1).
Ensure that X11Forwarding is enabled on server: In /etc/ssh/sshd_config set
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
On client (MacOS for me): In ~/.ssh/config set
ForwardX11 yes
In PyCharm deselect Include system environment variables. This resolves the issue that the DISPLAY variable gets set to the system variable.
EDIT: As seen in the below image it works. For example I used the PyTorch implementation of DeepLab and visualize sample images from PASCAL VOC:
X11 forwarding was implemented in 2021.1 for all IntelliJ-based IDEs. If it still doesn't work, please consider creating a new issue at youtrack.jetbrains.com.
By the way, the piece of advice about patching jsch won't work for any IDE newer than 2019.1.
In parallel, open MobaXTerm and connect while X11 forwarding checkbox is enabled. Now PyCharm will forward the display through MobaXTerm X11 server.
This until PyCharm add this 'simple' feature.
Also, set DISPLAY environment variable in PyCharm run configuration like this:
DISPLAY=localhost:10.0
(the right hand side should be obtained with the command echo $DISPLAY in the server side)
Update 2022: for PyCharm newer than 2022.1: Plotting in SciView works by only setting ForwardX11 yes in .ssh/config (my laptop OS is ubuntu 22.04). I did not set any other parameters either on the server or local side.

virsh console hangs whenever I connect to Virtual Machine

Whenever I try to connect to VM using virsh console <vm name> my screen hangs and displays:
Connected to domain <vm name>
Escape character is ^]
I have found many solutions on the internet but nothing has worked for me and I am even not able to find the /etc/init directory as CentOS 7 has a different directory structure.
I need /etc/init directory to create a script which I found on the internet as a solution.
I am using only ssh connection and no GUI and I do not have any access to the physical machine.
I think you should start a console (e.g. ttyS0 ).
For example on my Debian 8 I enable it with systemd:
systemctl enable getty#tty1.service
Enable Serial Console on CentOS/RHEL 7
On the virtual machine, add ‘console=ttyS0‘ at the end of the kernel lines in the /boot/grub2/grub.cfg file:
grubby --update-kernel=ALL --args="console=ttyS0"
Note: Alternatively, you can edit the /etc/default/grub file, add console=ttyS0 to the GRUB_CMDLINE_LINUX variable and execute
grub2-mkconfig -o /boot/grub2/grub.cfg
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial –speed115200 –unit=0 –word=8 –parity=no –stop=1"
I had the same issue right after virt-install, then after trying to connect to the guest, too. I tried all the suggested solutions but none of them helped. Then I realized that I forgot to install KVM. A simple 'yum -y install kvm' resolved the issue.

Vagrant stuck in "Waiting for VM to Boot"

I want to preface this question by mentioning that I have indeed looked over most if not all vagrant "Waiting for VM to Boot" troubleshooting threads:
Things I've tried include:
vagrant failed to connect VM
https://superuser.com/questions/342473/vagrant-ssh-fails-with-virtualbox
https://github.com/mitchellh/vagrant/issues/410
http://vagrant.wikia.com/wiki/Usage
http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time
And more.
Here's how I setup my Vagrant:
Note: We are using Vagrant 1.2.2 since we do not at the moment have time to change configs to newer versions. I am also using VirtualBox 4.2.26.
My office has an /official/ folder which includes things such as Vagrantfile inside. Inside my Vagrantfile are these custom settings:
config.vm.box = "my_box"
config.ssh.private_key_path = "~/.ssh/github_rsa"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.ssh.max_tries = 300
config.vm.provision :shell, :inline => "/etc/init.d/networking restart"
I installed our custom box (called package.box) via vagrant box add my_box absolute_path/package.box which went without a hitch.
Running vagrant up, I would look at the "preview" of the VirtualBox, and it would simply be stuck at the login page. My Terminal would also only say: Waiting for VM to boot. This can take a few minutes. As far as I know, this is an SSH issue. Or my private key issues, though in my Vagrantfile I explicitly pointed to my private key location.
Interesting Notes:
Running dhclient within the VirtualBox GUI, it says command no found. Running sudo dhclient eth0 was one of the suggested fixes.
This fix: https://superuser.com/a/343775/298915 of "modify the /etc/rc.local file to include the line sh /etc/init.d/networking restart just before exit 0." did nothing to fix the issue.
Conclusion:
Having tried to re-install everything thinking I messed up a file, it did not seem to ameliorate the issue. I am unable to work with this issue. Could someone give me some insight?
So after around twelve hours of dejected troubleshooting, I was able to (finally) get the VM to boot.
Setup your private/public keys using the link provided. My box is a Debian Linux 3.2.0-4-amd64, so instead of /root/.ssh/id_rsa.pub, you have to use /home/vagrant/.ssh/id_rsa.pub (and the respective id_rsa path for the private key).
Note: make sure your files have the right permissions. Check using ls -l path, and change using chmod. Your machine may not have /home/vagrant/.ssh/authorized_keys, so generate that file with touch /home/vagrant/.ssh/authorized_keys.
Boot your VM using the VirtualBox GUI using (through either Vagrantfile boot-GUI command, or starting your VM using VirtualBox). Login using vagrant and vagrant when prompted.
Within the GUI, manually start dhclient using sudo dhclient eth0 -v. Why is it off by default? I have no idea. I found out that it was off when I tried to wget the private/public keys in the tutorial above, but was unable to.
Go to your local machine's command line and reload vagrant using vagrant reload. It should boot, and no longer hang at "Waiting for VM to Boot."
This worked for me. Though it may be different for other machines, for whatever reason Vagrant likes to break.
Suggestion: can this be saved as a script so we don't need to manually do this everytime?
EDIT: Update to the latest version of Vagrant, and you will never see this issue again. About time, huh?