互联网人

简单就是美

RSS FeedsFollow me on Twitter!

  • Home

Opera Twitter Widgets For GFW

Mar 9th

Posted by hujinpu in 作品

No comments

为了穿越GFW,我修改了Opera本身的Twitter Widgets,大家可以直接下载安装使用。

只需要解压Opera Twitter Widget For GFW.zip,打开opera浏览器,将TwitterGFW.wgt拖动到任意浏览窗口即可安装。

GFW, Opera, Twitter

在Windows主机中实现VirtualBox端口映射

Mar 9th

Posted by hujinpu in 操作系统

No comments

原文来自zoot的博客,由于GFW,特转载到这里,方便大家浏览。

VirtualBox is a free, powerful and versatile virtualization program which is available for Linux, Mac, and Windows hosts, and can virtualize many different Operating Systems. VirtualBox was originally developed by innotek, but was purchased by Sun and renamed Sun xVM VirtualBox. There are several versions of the program, but I use the free closed-source version, since it has more features than Virtualbox OSE.

Several networking modes are available for the Virtualbox guest OS to connect to the Internet, but I will specifically mention Network Address Translation (NAT) networking here.

The Virtualbox manual describes the advantages and disadvantages of NAT in this way:

Network Address Translation (NAT) is the simplest way of accessing an external network from a virtual machine. Usually, it does not require any configuration on the host network and guest system. For this reason, it is the default networking mode in VirtualBox.

A virtual machine with NAT enabled acts much like a real computer that connects to the Internet through a router. The “router”, in this case, is the VirtualBox networking engine, which maps traffic from and to the virtual machine transparently. The disadvantage of NAT mode is that, much like a private network behind a router, the virtual machine is invisible and unreachable from the outside internet; you cannot run a server this way unless you set up port forwarding (described below).

So, your shiny new virtual machine can access the net, but is invisible to other devices on your network. Usually this isn’t an issue, but it isn’t possible to ssh into your virtual machine or access any services of the machine (such as a webserver) without configuration of port forwarding.

PORT FORWARDING IN VIRTUALBOX:

Port Forwarding can be initiated through the powerful and versatile VBoxManage command-line utility. VBoxManage has many options, but we will be using the “setextradata” feature to configure port forwarding.

The following commands will allow you to access your virtual machine via ssh. For this to work, I am making several assumptions about the guest OS:

* Your virtual machine is not currently running, but has already been created and saved.
* Your guest OS has ssh installed and correctly configured
* Your guest OS is set up with the VirtualBox’s default virtual network hardware (PCNET III)
* sshd is listening for incoming connections at the default port (port 22)
* Your guest OS is named “VM Name Here”, although I’d wager that isn’t the actual name of your VM.

If you don’t know the name of your virtual machine, the easiest way to verify the name is to start Virtualbox and to look at the names of the machines listed on the main screen. Scrolling down on the details also allows you to see other information, such as the network adapter being used.

The following commands will forward TCP traffic that originates from port 2222 on your host OS to port 22 on your guest OS:

$ VBoxManage setextradata “VM Name Here” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol” TCP

$ VBoxManage setextradata “VM Name Here” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort” 22

$ VBoxManage setextradata “VM Name Here” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort” 2222

Note the usage of double quotes for the virtual machine name. If you decided on a virtual machine name that is only one word such as “VMNameHere”, you can technically omit these double quotes, like this:

$ VBoxManage setextradata VMNameHere “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol” TCP

$ VBoxManage setextradata VMNameHere “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort” 22

$ VBoxManage setextradata VMNameHere “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort” 2222

There is no harm done in leaving them there, so do whatever makes you feel most comfortable.

FYI, there are some limitations to NAT port forwarding, and I will list them as they are listed in the VirtualBox Manual:

There are four limitations of NAT mode which users should be aware of:

  • ICMP protocol limitations: Some frequently used network debugging tools (e.g. ping or tracerouting) rely on the ICMP protocol for sending/receiving messages. While ICMP support has been improved with VirtualBox 2.1 (ping should now work), some other tools may not work reliably.
  • Receiving of UDP broadcasts is not reliable: The guest does not reliably receive broadcasts, since, in order to save resources, it only listens for a certain amount of time after the guest has sent UDP data on a particular port. As a consequence, NetBios name resolution based on broadcasts does not always work (but WINS always works). As a workaround, you can use the numeric IP of the desired server in the \\server\share notation.
  • Protocols such as GRE are unsupported: Protocols other than TCP and UDP are not supported. This means some VPN products (e.g. PPTP from Microsoft) cannot be used. There are other VPN products which use simply TCP and UDP.
  • Forwarding host ports lower than 1024 impossible: On Unix-based hosts (e.g. Linux, Solaris, Mac OS X) it is not possible to bind to ports below 1024 from applications that are not run by root. As a result, if you try to configure such a port forwarding, the VM will refuse to start.

These limitations normally don’t affect standard network use. But the presence of
NAT has also subtle effects that may interfere with protocols that are normally working. One example is NFS, where the server is often configured to refuse connections from non-privileged ports (i.e. ports not below 1024).

VBoxManage is an incredibly powerful utility, and this post just scratches the surface of its abilities. There is an entire section of the user manual dedicated to VBoxManage, and I encourage you to read it and discover the other things it can do.

补充:你还可以执行 VBoxManage.exe getextradata “name of vm” enumerate 在重启虚拟机后来查看端口映射状态

ssh, VirtualBox

w3er.com重新开张了

Mar 8th

Posted by hujinpu in 建站

2 comments

w3er.com重新开张了,欢迎各位朋友拍砖。

本站现在基于 Linux + nginx + mysql  + wordpress,nginx确实很cool。

建站
  • Search

    • Popular posts
    • Archives
    • Tags
    • Categories
    • 作品 (1)
    • 建站 (1)
    • 操作系统 (1)
    建站 GFW Opera ssh Twitter VirtualBox
    • March 2010 (3)
    • w3er.com重新开张了 (2)
    • 在Windows主机中实现VirtualBox端口映射 (0)
    • Opera Twitter Widgets For GFW (0)
  • Recent Posts

    • Opera Twitter Widgets For GFW
    • 在Windows主机中实现VirtualBox端口映射
    • w3er.com重新开张了
  • Recent Comments

    • Jerry Qu: 来支持下~
    • jprintf: 加油啦,胡总。
    • About me

      我热爱这片土地

    • Latest Tweets

      • Jinpu Hu 为了穿越GFW,我修改了Opera本身的Twitter Widgets,大家可以直接下载安装使用。 http://w3er.com/works/opera-twitter-widgets-for-gfw/ - posted on 09/03/2010 11:46:44
      • Jinpu Hu http://w3er.com reopen 弄了一个vps 自己从安装os到server完整的做了一回op - posted on 09/03/2010 11:04:27
      • Jinpu Hu chrome bird 不错 http://bit.ly/5H2ih4 - posted on 05/03/2010 00:10:21
      • Jinpu Hu 打算分享一个css layout的topic,关于display: table - posted on 25/02/2010 17:53:29
      • Jinpu Hu 加油 - posted on 14/02/2010 23:13:30
      • Jinpu Hu 新年好 - posted on 14/02/2010 00:09:35
      • Jinpu Hu 疲劳 - posted on 13/02/2010 15:09:53
      • Jinpu Hu 最近作品:http://zhidao.baidu.com全流量上线,欢迎浏览。 - posted on 12/02/2010 14:24:10
      • Jinpu Hu 锦衣卫从头打到尾 - posted on 09/02/2010 12:25:34
      • Jinpu Hu 回到长沙过年..... - posted on 08/02/2010 18:34:53
    • Blogroll

      • aoao
      • JerryQu
      • 你要找的正在找你
      • 北国骑士
      • 岁月如歌
RSS Feeds XHTML 1.1 Top