Closed cpats007 closed 2 years ago
I have added the ability to be able to specify a web port for forwarding also - hope this is okay. It means that locally I can access 127.0.0.1:8888 and it will forward that to the Vagrant guest to port 80 - so the web server basically
Thanks a lot.
I hope we could adapt to vagrant's 'Forwarded Ports' . Want to give it a try?
Also, the version number is not normally updated in PR.
I'm not overly familiar with developing plugins for Vagrant (on account of never doing any ha ha) and also getting into Ruby for the first time - I was thinking that already and using an array of forwarded ports to create the QEMU cli options, but I'm unsure how we get the main config.vm.network "forwarded_port" information from the Vagrant file - is this passed to the plugin somehow or can we get it by calling a key in the plugin?
Once I have that information should be able to work something out.
In other news, I've also tested NFS sharing from MacOS to Vagrant and this seems to be working well but it is a very manual process at the moment - now I understand the basics, I just need to work out how we can add this to the plugin (I only know OSX for now) and then file sharing over NFS should also work
This is a massive step forward for Vagrant on M1 Macs 😄
About the NFS, I have also tested it before. To make it work within a vagrant provider, it needs to be able to generate a list of all live machines, then the vagrant uses this list to purge the system's export file (to delete items that are already useless). For example, the VirtualBox provider will list live VMs. This work could be done by using a file as a list to remember all live qemu machines.
About the forward port thing, I have no idea now. I think reading the source code of other providers should be the first step. They are in the vagrant's source tree.
I'll try it next weekend if I have some free time.
Fix in v0.1.7. Please try it.
There is a basic example in the Readme.