{"id":1422,"date":"2010-02-05T20:10:27","date_gmt":"2010-02-06T03:10:27","guid":{"rendered":"http:\/\/softbeam.net\/hobby\/?p=1422"},"modified":"2010-02-05T20:10:27","modified_gmt":"2010-02-06T03:10:27","slug":"set-up-port-forwarding-for-guest-linux-server-inside-virtualbox-on-windows-host","status":"publish","type":"post","link":"http:\/\/softbeam.net\/hobby\/?p=1422","title":{"rendered":"set up port forwarding for guest linux server inside virtualbox on windows host"},"content":{"rendered":"<p>mostly for httpd and sshd, under dos:<\/p>\n<blockquote>\n<pre><code>VBoxManage setextradata \"<em>GuestName<\/em>\u201d  \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/<em>guesthttp<\/em>\/Protocol\u201d TCP<\/code><\/pre>\n<pre>VBoxManage setextradata \u201c<em>GuestName<\/em>\u201d  \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/<em>guesthttp<\/em>\/GuestPort\u201d 80<\/pre>\n<pre>VBoxManage setextradata \u201c<em>GuestName<\/em>\u201d  \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/<em>guesthttp<\/em>\/HostPort\u201d  8880<\/pre>\n<\/blockquote>\n<p>and<\/p>\n<blockquote>\n<pre><code>VBoxManage setextradata \"<em>GuestName<\/em>\u201d   \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/<em>guestssh<\/em>\/Protocol\u201d TCP<\/code><\/pre>\n<pre>VBoxManage setextradata \u201c<em>GuestName<\/em>\u201d   \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/<em>guestssh<\/em>\/GuestPort\u201d 22<\/pre>\n<pre>VBoxManage setextradata \u201c<em>GuestName<\/em>\u201d   \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/<em>guestssh<\/em>\/HostPort\u201d 22<\/pre>\n<\/blockquote>\n<p>\u53d1\u73b03.2.4\u91cc\u5934vboxmanage\u5df2\u7ecf\u4e0d\u7528setextradata\u6765\u8bbe\u7f6ePort Forwarding\u4e86\uff0c\u800c\u662f\u6539\u6210\u66f4\u7b80\u6d01\u6613\u61c2\u7684:<\/p>\n<blockquote>\n<div>VBoxManage modifyvm &#8220;Ubuntu&#8221; &#8211;natpf1 &#8220;guestssh,tcp,,2222,,22&#8221;<\/div>\n<\/blockquote>\n\n\n<p>New version of VirtualBox is getting easier just use port forwarding under the &#8220;setting-network&#8221;. However, sometime it&#8217;s just weird that no matter how you tweak the host machine ports Putty ssh won&#8217;t get through. And easier way is to use the &#8220;Bridged Adaptor&#8221; instead of &#8220;NAT&#8221;. Using this MAC address to set up HWADDR in ifcfg-eth0: <strong>vi \/etc\/sysconfig\/network-scripts\/ifcfg-eth0; <strong>service sshd start<\/strong><\/strong>; <strong>service network restart<\/strong>, if you got error: <strong>Bringing up interface eth0:\u00a0 Device eth0 does not seem to be present,delaying initialization.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 [FAILED]<\/strong> This means the eth0, use <strong>ifconfig -a<\/strong> to know actually which eth<strong>X<\/strong> you should bring up and edit the ifcfg-eth0 to replace the eth0.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mostly for httpd and sshd, under dos: VBoxManage setextradata &#8220;GuestName\u201d \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/guesthttp\/Protocol\u201d TCP VBoxManage setextradata \u201cGuestName\u201d \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/guesthttp\/GuestPort\u201d 80 VBoxManage setextradata \u201cGuestName\u201d \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/guesthttp\/HostPort\u201d 8880 and VBoxManage setextradata &#8220;GuestName\u201d \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/guestssh\/Protocol\u201d TCP VBoxManage setextradata \u201cGuestName\u201d \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/guestssh\/GuestPort\u201d 22 VBoxManage setextradata \u201cGuestName\u201d \u201cVBoxInternal\/Devices\/pcnet\/0\/LUN#0\/Config\/guestssh\/HostPort\u201d 22 \u53d1\u73b03.2.4\u91cc\u5934vboxmanage\u5df2\u7ecf\u4e0d\u7528setextradata\u6765\u8bbe\u7f6ePort Forwarding\u4e86\uff0c\u800c\u662f\u6539\u6210\u66f4\u7b80\u6d01\u6613\u61c2\u7684: VBoxManage modifyvm &#8220;Ubuntu&#8221; &#8211;natpf1 &#8220;guestssh,tcp,,2222,,22&#8221; New version of VirtualBox is getting easier just use port &hellip; <a href=\"http:\/\/softbeam.net\/hobby\/?p=1422\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;set up port forwarding for guest linux server inside virtualbox on windows host&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1422","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=\/wp\/v2\/posts\/1422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1422"}],"version-history":[{"count":0,"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=\/wp\/v2\/posts\/1422\/revisions"}],"wp:attachment":[{"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1422"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/softbeam.net\/hobby\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}