ajoo Posted February 21, 2018 Share Posted February 21, 2018 Hi all, I have a linux VM on my Windows computer and I use that for testing. I also have a xampp installed on my Windows machine and that is the default local host for the windows machine. So is it possible for me to make the VM act as a localhost for the windows machine as well? If so, how? I hope that my question is clear. I need to do this since I it's difficult to debug my flash files as the rest of the project is on the VM. I don't want to take move all the stuff back into the windows machine just to test the flash files there. Thanks all ! Quote Link to comment https://forums.phpfreaks.com/topic/306612-can-i-make-a-virtual-machine-the-localhost-on-my-computer/ Share on other sites More sharing options...
kicken Posted February 21, 2018 Share Posted February 21, 2018 If you mean make http://localhost/ point to the VM, then afaik no you cannot do that (unless you proxy it). What you can do is edit your hosts file and add a new entry that points to your vm's IP address, say vm. Then you could use http://vm/ to connect to your VM. 2 Quote Link to comment https://forums.phpfreaks.com/topic/306612-can-i-make-a-virtual-machine-the-localhost-on-my-computer/#findComment-1556623 Share on other sites More sharing options...
gizmola Posted February 24, 2018 Share Posted February 24, 2018 To follow up on Kickens suggestion, here are instructions for how to find the Windows hosts file. It's just a text file so notepad or any other text editor will do. I don't know what virtualization tech you are using, but they all have ways of sharing folders. This is the typical way that people develop. All your source is in a shared folder, so you can edit and see the results reflected by the serving of content from the VM. The hosts file is a nice way to do that, but if you do follow that I would suggest you use a domain.tld. This is due to the issues that can occur with cookies when you don't use a "normal" domain name. The special reserved tld's in RFC2606 are: .test, .example, .invalid and .localhost. I will use something like: 192.168.168.4 www.someproject.test 1 Quote Link to comment https://forums.phpfreaks.com/topic/306612-can-i-make-a-virtual-machine-the-localhost-on-my-computer/#findComment-1556685 Share on other sites More sharing options...
ajoo Posted February 26, 2018 Author Share Posted February 26, 2018 Hi, Thanks Kicken & Gizmola, Thanks for the reply and suggestions. I am. in fact, already doing as suggested by you both. The problem lies with flash files that (i think) can be run only in the windows environment.To test locally on flash therefore I needed to work in windows and so needed the localhost on windows. In any case, I have eventually ported portions of the code in windows and am able to test locally now using localhost. Thanks very much ! Quote Link to comment https://forums.phpfreaks.com/topic/306612-can-i-make-a-virtual-machine-the-localhost-on-my-computer/#findComment-1556744 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.