How can I use VirtualBox, Vagrant, Nginx together in Windows10 v1903?
I'm watching a course on learning Nginx. This course demands that I should have all 3 (VB, Vagrant, Nginx) running on my machine. I've Win10-64bit-v1903 machine. Which has Bash (version 4.4.20(1)-release (x86_64-pc-linux-gnu). And inside bash, I've Ubuntu 18.04.3 .
Now my problem is that most of the commands demand that I be under Linux/Ubuntu. But inside Ubuntu, VB (and perhaps Vagrant also) isn't working/behaving well. And outside bash, (inside Windows), Nginx doesn't behave/work well.
In Bash Ubuntu, VB installs very well without errors, but when running, gives this error:
WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-Microsoft.
You will not be able to start VMs until this problem is fixed.
5.2.32_Ubuntur132056
And, although my attention is yet on running VB only, but Vagrant also seems to be throwing some errors inside bash ubuntu. Aren't they supposed to run inside bash?
Is there some work around to my problem (I only have 1 machines, running win10 on it).
Simple: It's not possible to do that with 1903.
TLDR: Due WSL 1 shipped with 1903 does not have a "real" kernel, it's not possible to load kernel driver. And maybe (i have never tested, just guess) you can get this work in WSL 2 which using Hyper-V technology, but you can't get best performance with nested virtualization.
Since you are using Vagrant VM to writing code or running application, host environment doesn't affect things inside VM, so you can try to install VirtualBox and Vagrant on you Windows, install nginx in WSL.
All disk partition in Windows already mounted in /mnt, and localhost port listen was connected between WSL and Windows.
BTW: Files in WSL can be access on Windows with run explorer.exe . in bash, or type \\wsl$ in explorer's address bar.
Oracle VM VirtualBox can be used on a Windows host where Hyper-V is running. This is an experimental feature.
No configuration is required. Oracle VM VirtualBox detects Hyper-V automatically and uses Hyper-V as the virtualization engine for the host system. The CPU icon in the VM window status bar indicates that Hyper-V is being used.
https://www.virtualbox.org/manual/UserManual.html#hyperv-support
Oracle said vb can auto detect hyper-v and run with it,but i always stuck when i use wsl2.
@zyazhb WSL 1 didn't use Hyper-V
Oracle VM VirtualBox can be used on a Windows host where Hyper-V is running. This is an experimental feature.
Windows QEMU too in recently (for some value of recent) releases. I had tried it when WSL2 came out last spring.
These are third-party products; you can get more information from their respective purveyors.