Access VM Ubuntu running application using Hyper-V with host browser - hyper-v

I got a question about Hyper-v VM capability. I have a Ubuntu VM and inside it, Im running a service locally. I am able to see it and use it within the VM browser. However, I want to be able to use within my host browser. Inside my VM session, I write localhost:8080 and I can access the platform of my program. However, when I try this in my host computer browser, I cant access it.
Is there a way to be able to access the platform using localhost:8080 within my host web browser?
Thanks in advance!

Did you try to type the IP address of your Ubuntu VM :8080 ?
like http://ubuntuVM:8080/ or https://192.168.1.22:8080 ? (replace with the correct address/name)
localhost is a loopback address, it redirects to 'self'

Related

Hugo webserver not reaching my Windows vm

I want to test my website on edge and internet explorer so I tried using a windows VM, I am currently on linux mint 19.1, I start the gohugo server with "hugo server --disableFastRender" and create the VM in virtualbox using bridged adapter but I cant load localhost:1313 on the vm.
I tried using NAT and port forwarding but I have the same results, also tried the conection between the host and VM using ping and the VM can reach the host but the host cant connect to the VM so I guess that the problem is there but I dont know what to do now. The place where I am working uses IPv6 and I never worked with it before so maybe it has something to do with that
Start your site as usual with hugo server, which makes it available at http://localhost:1313
Leave your Windows VM network settings at their defaults
In your Windows VM, navigate to http://10.0.2.2:1313 to hit your hugo site
In a nutshell, 10.0.2.2 on your Windows VM (its default gateway) is equivalent to localhost on your linux host.
You can get the default gateway of your Windows VM by running ipconfig in Command Prompt.

Why can't my friends access my website built with Apache2?

So, I have been building this website with HTML and I decided to host it with on Apache2. It runs on an Ubuntu and me already changed the VM assigned Ip, which is 10.2.0.15, into another one. I can access it on the Mac where the VM is, but I asked my friend if he can open it, and he said it was a 404 Server not found error.
Please help!
You probably need to enable port forwarding:
https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/
You haven't indicated what VM software you are using, but the above is for VirtualBox. VMware is a bit different. Also make sure your router is not blocking any packets or any firewall.

Connecting Vagrant VM to LAN

I am running Vagrant and VirtualBox on Ubuntu 14.04. My web app is built with Laravel and uses Homestead.
The application makes a web service call to a machine on my local area network. I can successfully reach the server from my OS web browser.
However, my web application cannot access this web service as it does not appear to be sharing my local network settings.
Based on my Google searches I have tried changing the Network settings in VirtualBox under the "Attached To" setting. Changing Adapter 1 to Bridged Adapter. However, this did not work.
Is there a way to allow my VM to communicate with a web service on my LAN?
aaronfarr,
I have as host Win7_64 with VirtualBox and as VM an openSuse.
With network configured like in the below picture and also inside VM the same proxy settings like on host, I can do same things both on VM and host machine.

Can I run a server in a VM and then make requests to it in the host OS?

I'm developing a web application in Ubuntu run in VM Ware Player. The VM is hosted on my Windows 8.1 machine. I want to test the application in Internet Explorer, so is there any way I can make requests to the server and test the application from the host OS?
Yes you can. You need to check the ip address of your VM
type this in ubuntu terminal:
ifconfig
check what ip address it uses then you can access it through browser

How can I run Selenium tests when my site is in Vagrant?

I use Vagrant for my local development. Now I want to use Selenium for automated browser testing. When I setup Selenium in my VM, it works like a charm (great stuff by the way).
But now I want to move the Selenium testing out of the box. I tried to run the Java server on my host machine, forward port 4444 to port 4444 in virtualbox, and then fire the phpunit-command in VirtualBox, hoping to trigger the server on my host machine.
But instead I get a CURL-message that phpunit can't connect to 127.0.0.1:4444, so obviously there is no connection to my host machine on this port.
Can anyone tell me what I'm doing wrong?
Edit: I figured out that when I'm running the server on the host, I cannot access 127.0.0.1:4444 in my browser, however, I am able to access localhost:4444. Which is weird, because my hosts-file has the correct line (although it shouldn't matter since phpunit is trying to access a numeric address).
I think the best solution for this is to setup a "private network" this way you'll be able to use internal address to access your vm and host separately...
Depending of your vm provider different solution are possible (for example, Virtualbox support internal netowrk only)
Have a look at : http://docs.vagrantup.com/v2/networking/private_network.html