{"id":203,"date":"2013-08-23T21:13:01","date_gmt":"2013-08-23T21:13:01","guid":{"rendered":"http:\/\/www.notnull.ro\/log\/?p=203"},"modified":"2014-01-19T18:18:46","modified_gmt":"2014-01-19T18:18:46","slug":"virtualbox-how-to-acccess-apache-webserver-installed-on-guest-linux-debian-from-host-windows-7","status":"publish","type":"post","link":"https:\/\/notnull.ro\/log\/virtualbox-how-to-acccess-apache-webserver-installed-on-guest-linux-debian-from-host-windows-7\/","title":{"rendered":"virtualbox: how to acccess apache webserver installed on guest (linux &#8211; Debian) from host (windows 7)"},"content":{"rendered":"<p>Few days ago I&#8217;ve installed VirtualBox from Oracle on my windows7 machine because I needed a linux where to play with apache webserver.<\/p>\n<p>The instalation was very easy (I assume that internet is available on the host system :D)<\/p>\n<ol>\n<li>Installed VirtualBox<\/li>\n<li>Created a guest machine for Debian<\/li>\n<li>Downloaded Debian Netinstall Image; it is a small CD image which allow ou to install Debian via network. Just google for\u00a0<strong>debian netinst iso <\/strong>, and you should get the latest version.<\/li>\n<li><em><\/em>Tell to VirtualBox to boot first from the downloaded iso file, and &#8220;start&#8221; the guest machine.<\/li>\n<li>Machine <em>boots<\/em> and next steps are straightforward<em>: <\/em>select language, partition disk, select and install packages<em><\/em><\/li>\n<li>The guest machine will then <strong>download the needed packages from the internet<\/strong> and will be installed.<\/li>\n<\/ol>\n<p>Then I made a login to the guest system and play a little with apache, browsing etc&#8230;<\/p>\n<p>My expectation was I&#8217;ll be able to browse the guest apache from the host system.<\/p>\n<p>It does not work by default installation :(&#8230; so, I had to read some docs \ud83d\ude00 .<\/p>\n<p>The idea is that on default install the VirtualBox will create an network adapter of type NAT (Network Address Translation). This type of adapter will permit to the guest to browse om Internet via host IP; but it does not allow connections to the guest.<\/p>\n<p>Just stop the guest operating system and in VirtualBox Manager go to <strong>Settings-&gt;Network<\/strong> and change the network adapter from <strong>NAT<\/strong> to <strong>Bridged Adapter<\/strong> like in next picture.<\/p>\n<div>\n<a href=\"http:\/\/www.notnull.ro\/log\/wp-content\/uploads\/2013\/08\/network_select_bridged.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-204\" alt=\"network_select_bridged\" src=\"http:\/\/www.notnull.ro\/log\/wp-content\/uploads\/2013\/08\/network_select_bridged.png\" width=\"643\" height=\"467\" srcset=\"https:\/\/notnull.ro\/log\/wp-content\/uploads\/2013\/08\/network_select_bridged.png 643w, https:\/\/notnull.ro\/log\/wp-content\/uploads\/2013\/08\/network_select_bridged-300x217.png 300w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a>\n<\/div>\n<p>If you have more than one network adapter on your host system, be sure that in the same window you have selected the proper one. See <strong>Name:<\/strong> field, in my case the active one was the Wireless LAN the one that has internet access, so I&#8217;ve selected that one. Be sure that <strong>Cable connected <\/strong> checkbox is on.<\/p>\n<p>No other settings are needed.<\/p>\n<p>Click <strong>OK <\/strong> and restart your guest operating system.<\/p>\n<p>If you are in a DHCP network (IPs allocated dynamic) do login on the guest operating system and run the <strong>ifconfig<\/strong>\u00a0 command to see what IP was alocated. E.g in my case I got:<\/p>\n<pre>&gt;ifconfig\r\n\r\neth0      Link encap:Ethernet  HWaddr 08:00:27:d7:2d:94  \r\n          inet addr:<strong>192.168.1.105<\/strong>  Bcast:192.168.1.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::a00:27ff:fed7:2d94\/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:51 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:75 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:14365 (14.0 KiB)  TX bytes:10874 (10.6 KiB)\r\n\r\nlo        Link encap:Local Loopback  \r\n          inet addr:127.0.0.1  Mask:255.0.0.0\r\n          inet6 addr: ::1\/128 Scope:Host\r\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1\r\n          RX packets:60 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:23077 (22.5 KiB)  TX bytes:23077 (22.5 KiB)<\/pre>\n<p>Then I just go to the host system and browse to http:\/\/192.168.1.105\/ , and all was fine.<\/p>\n<p>If you are not an a DHCP network (ou are using static IPs), you have to set also the IP on the guest system. The same <strong>ifconfig<\/strong> command needs to be used, and it will require\u00a0<strong>root <\/strong>permissions.<\/p>\n<p>More info and details about network adapters available on VirtualBox virtualmanchine cahn be found here <a title=\"http:\/\/www.virtualbox.org\/manual\/ch06.html\" href=\"http:\/\/www.virtualbox.org\/manual\/ch06.html\" target=\"_blank\">http:\/\/www.virtualbox.org\/manual\/ch06.html<\/a><\/p>\n<p>Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few days ago I&#8217;ve installed VirtualBox from Oracle on my windows7 machine because I needed a linux where to play with apache webserver. The instalation was very easy (I assume that internet is available on the host system :D) Installed VirtualBox Created a guest machine for Debian Downloaded Debian Netinstall Image; it is a small <a href='https:\/\/notnull.ro\/log\/virtualbox-how-to-acccess-apache-webserver-installed-on-guest-linux-debian-from-host-windows-7\/' class='excerpt-more'>&#8230; Read Full Article<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,8,7,35],"tags":[59,61,62,65,63,55,58,60,64,56,57],"class_list":["post-203","post","type-post","status-publish","format-standard","hentry","category-internet","category-linux","category-unix","category-windows","tag-adapter","tag-address","tag-apache","tag-bridged-adapter","tag-debian","tag-guest","tag-host","tag-machine","tag-nat","tag-network","tag-virtualbox","category-42-id","category-8-id","category-7-id","category-35-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/comments?post=203"}],"version-history":[{"count":7,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/203\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/203\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/media?parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/categories?post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/tags?post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}