Virtual hosts inside virtual box - windows-xp

I've just installed virtual box along with windows xp to test websites in the all mighty IE 8 and below.
My default gateway on VB is 10.0.2.2 which shows my wamp homepage from host desktop.
On the hostdesktop I have:
127.0.0.1 test.com
which points to wamp/www/test in config
How do I get virtual box windows xp to takes me to the right location test.com? I've tried editing the windowsxp hosts file to add 10.0.2.2 test.com
(10.0.2.2/test takes me to the page but is untestable because resources are relative to test.com)

I assume you host PC has an ip in the 192.168.x.x range.
If thats the case you can change the VM's Network settings so Adapter1 is set to
Attached to: Bridged Adapter
Name: Realtec PCIe GBE Family Controller
Adapter Type: Intel Pro/1000 MT Desktop
Promiscuous Mode: Deny
Mac Address: ????????
This for me made the VM part of the same subnet and allowed easy access to the host
So if your host IP is lets say 192.168.0.20 and your VB has a dynamically allocated 192.168.0.100
You can set yout HOSTS file on the VB as you might more readily expect
192.168.0.20 test.com

Related

Why am I unable to ping my host machine from vm machine even though the network is bridge?

I have been facing an issue with VMware which is unable to ping host machine from Guest Machin, but I'm able to ping guest machine from host machine.
Note: Here one more interesting matter is I could able to ping my host machine from guest machine with NAT network, but I couldn't ping my guest machine from host machine.
Your question is not clear at all.
In any case, you might wish yo specify what OS you are using in both nodes.
Firewall issues? You could try to disable Windows firewall for instance and locate where is the issue.
Could you give some basic data of the IP address of both nodes when the set up is in bridge mode?
Instead of disabling the firewall. Enable Rule "File and Printer Sharing (Echo Request - ICMPv4-In)" from Inbound Rules on both Host and the VMWare Workstation. In some host machines or VMWare Workstation you may find multiple Rules with the same name "File and Printer Sharing (Echo Request - ICMPv4-In)", make sure you enable all.

Not able to connect to my server

I have a small local network, with the following devices: a router , a Dell laptop running Ubuntu 16.04 LTS as my server, and another HP laptop to test access.
My IP addresses look like this:
router: 192.168.0.1
server: 192.168.0.101
laptop: 192.168.0.100
I have successfully setup LAMP and have one small page (/var/www/html/index.html) with one picture. I can't access this from my HP laptop by entering 192.168.0.101 into Firefox or Chrome.
In order to access your server you have to make it publicly so I will describe the steps required to do it:
Login to your router, search for Port Forwarding section and forward the port 80(HTTP Port) to 192.168.0.101(Your Web Server). You can find a guide for Port Forwarding after selecting your router model here : https://portforward.com/router.htm
Access your webserver by your external Ip. http://yourexternalip
(Optional) If you have dynamic Ip, you can set a Dynamic DNS to create a domain name that will always point to your webserver even your Ip will change after a router reboot or something like that. You can read this guide for setting up a DDNS: https://www.howtogeek.com/66438/how-to-easily-access-your-home-network-from-anywhere-with-ddns/

configure ip for bitnami owncloud virtual appliance

I installed Bitnami owncloud virtual appliance stack on Virtual box and within no time, I was able to sync files to and from this box. However, the main problem with Virtual Box is that the IP address keeps changing when the owncloud instance is powered off and then turned back on - which makes sense. Is there any way to keep the server IP static so that we don't need to configure the clients everytime the IP is changed.
You could change the config (from auto to static) in the following way
sudo vi /etc/network/interfaces (“vi” or “nano”)
iface eth0 inet static
address 192.168.0.100
# your own IP
netmask 255.255.255.0
# network mask
gateway 192.168.0.1
# standard gateway (router)
dns-nameservers 192.168.0.1 8.8.8.8
# DNS (optional)
/etc/init.d/networking restart (restart network)
ifconfig
for the IP addresses check or you “shutdown –h now” (reboot)). Please, keep in mind that multiple copies need multiple IP's. In Virtual Box remember to switch between NAT and Bridge - if required.

make virtual host available through local network for iphone

I'm building a site on my localhost with a virtual host (mynewsite.com). Instead of uploading files to an actual server and I'd prefer to just test locally. I have the virtual host working on my desktop, I just want it to be available so I can see it on my iPhone or any computer on my network. So if I go to mynewsite.com on my iPhone it will display the site from my localhost. I think I need to do port forwarding but I'm having difficulty figuring it out. I'm on a Mac with MAMP.
How do I make the virtual host available to my iPhone through my Linksys router for testing?
My httpd.conf in MAMP looks like:
<VirtualHost *:80>
DocumentRoot "/Users/jaysonp/Sites/mynewsite"
ServerName "mynewsite.com"
ServerAlias *.mynewsite.com
...
Then in my host file I have:
127.0.0.1 mynewsite.com
I should note that I can't just hit the ipaddress on my iPhone, there is code that checks against the domain name for the site to work.
Thanks!
Please see my answer here. But basically, you just have to modify the Wifi settings in your iPad to use the IP address of your development machine as an HTTP proxy.
You can use application to edit hosts file on the devices. Use iFile application. You can add more any hostname. You can see some picture here but I wrote in my language.
http://www.anop72.info/iphoneipad-เรียก-url-vhost-ทำอย่างไร/
Hope this helps.
You just need to change the host file of respective machine on which you want to see your virtual host.
For Example:
(in Linux and macOS ): /etc/hosts
(in Windows ): c:/windows/system32/drives/etc/hosts
(in Android ): Android is also the part of linux so the host file location is same in android too. But you need root access to change the host file.
(in iOS ): (anyone who knows can edit here!!)
Open the host file and
192.168.1.70 mynewsite.com
192.168.1.70 is the ip address of the machine in which your project is running on a virtual hosting -> mynewsite.com
All of the other devices must be connected to the same network .
Just use the IP address of your virtual host. If your iPhone is on the same local network as your [virtual] host - the IP address will work fine.
I am not quite sure how you are defining "virtual" host - i.e. are you using Xen or VMware or something - or just running a web service on your dekstop?
If it is the former - you need to set up the IP services through Xen/VMware - if it's the later - its you desktop machine's IP address.

VMWare fusion: connecting to host's web server from guest

I am a web developer and my development platform is Mac. I have installed a copy of Windows XP in VMWare fusion for testing purposes and using IE for previwing my websites. I have Apache running on my Mac with several subdomains, like test.localhost etc.
How can I access the webserver on host OS from the guest OS?
Thank you in advance.
Using Fusion 6.0.2 on OS X 10.9 Mavericks
In the host system (Mac)
turn off your virtual machine
open the "Virtual Machine | Network Adapter | Network Adapter Settings..." menu
in the "Bridget Networking" section choose "Autodetect":
turn on your virtual machine
In the guest system (Win7)
right click on the Notepad application, then select "Run as administrator":
when Win7 asks: "Do you want to allow the following program to make changes to this computer?"
click on the "Yes" button
navigate to: "Computer | Local disk (C:) | Windows | System32 | drivers | etc"
select "All files" in the drop down menu on the right of the "file name:" field
double click the "hosts" file
In the host system (Mac)
open your system preferences and select "Network"; in your connected interface look for the Mac IP:
192.168.1.106 in the example
In the guest system (Win7)
in your notepad window enter the Mac IP followed by the sites you want to reach in your host (Mac) system:
in the example I configured two sites: localhost and caeb.leo
open the browser and you will be able to see the sites hosted on your host system:
Hope it helps!
VMWare Fusion registers an IP address on your Mac and you can use this to point to the host from the virtual machine. You can find it with ifconfig vmnet8. Mine's 192.168.36.1, yours might be the same.
If you're using apache virtual hosts and you try to get http from this address on your virtual machine, it will probably display the default apache page. You'll need to map the domains on your windows host:
Open C:\WINDOWS\system32\drivers\etc\hosts in Notepad and add your hostnames, 1 per line:
192.168.36.1 test.localhost
Then, when you put http://test.localhost/ in IE, it will route to your Mac's apache virtual host.
Andrew's answer, while correct, is missing a significant portion, namely that vmnet8 is only used when the guest OS is set to use the Bridged network option.
If your guest OS is using the NAT network option, as seen in this Windows host example, you would need to use vmnet1 instead.
In this case, the IP of vmnet1 192.168.119.1 allows access to the host webserver, while the IP of vmnet8 leads nowhere.
note, I provide this answer for those who, like me, have the same question as the title but not the exact same specifics of running Apache as a raw local installation
double note, this answer is a mix of Andrew and Camaleo's answer since neither worked in my set up (not pointing to Mac's ip and Bridged Networking's "Autodetect" wasn't working for some reason?) , not sure if the inclusion of Docker Machine causes the hiccup
If you're setup is like so:
(Host) Mac (example ip 192.168.1.249)
(Guest) Docker Machine (example ip 192.168.99.102)
Apache (port 80)
VMware Fusion 10
(Guest) Windows 10 (example ip 192.168.68.142)
Step 1
From within Windows 10 VM open Notepad as Administrator (right click notepad for the option). Navigate to C:\Windows\System32\drivers\etc and instead of Text Documents(*.txt) select All Files. Open the hosts file and add a hosts entry for your Docker Machine's IP(via docker-machine ls). Per our above example setup, the line would look like so:
192.168.99.102 myapp.test # or some other fitting name
Save changes.
Step 2
Note: No need to stop or restart your virtual machine in VMware Fusion 10 when making network changes.
From VMware Fusion Menus select Virtual Machine / Network Adapter / Network Adapter Settings. Choose Share with my Mac.
if "Share with my Mac" is already selected, select a different network adapter option (like Bridged Network Automatic) and then re-select "Share with my Mac" to ensure host file changes are taken
Step 3
Test changes are in place from within Windows VM by pinging the desired address (e.g "myapp.test" as shown above) or by opening Edge/Chrome checking if the webpage loads
note, using a domain name that ends in .test is recommended or Chrome may still have issues with HSTS errors