Skip to content

Instantly share code, notes, and snippets.

@GeekaholicLin
Last active September 9, 2018 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeekaholicLin/838dd3f4f7191d1b82edd7487c934130 to your computer and use it in GitHub Desktop.
Save GeekaholicLin/838dd3f4f7191d1b82edd7487c934130 to your computer and use it in GitHub Desktop.
virtualbox 共享host os的xx-net

最怕的就是各种配置,每次都得搜索很多,不断地折腾。

今天遇到了将本机的xx-net和虚拟机中的系统共享网络的需要,其实这个并不难。比如,在virtualbox中的网络设置,将网络模式设置为NAT连接就好。

但是,无论怎么设置都不能使得virtualbox中的Linux Mint共享XX-NET翻墙,也就是说不能在virtualbox宿主机器里面进行Google搜索

经过一番搜索,终于解决了,记下来,以方便以后自己或者遇到相同的问题的小伙伴。

    1. 设置xxnet为局域网共享状态。具体做法为:在XX-Net\data\gae_proxy目录下,备份config.iniconfig.ini.bak,然后编辑config.ini,部分设置如下。
'''
[proxy]
enable = 1
type = HTTP
host = 0.0.0.0
port = 8087
user = 
passwd = 

[google_ip]
max_scan_ip_thread_num = 300

[listen]
ip = 0.0.0.0
port = 8087
visible = 1
'''
    1. 重启xx-net
    1. 获取当前host os(也就是安装了虚拟机的那个系统)的ip地址(windows下使用ipconfig获取),比如192.168.111.1,     然后在guest os(也就是在虚拟机里面的系统),设置系统代理为192.168.111.1:8087,也就是host os的ip加上xx-net的proxy端口号,设置网络类型为桥接;
    1. 此时连接会提示不安全的连接config.ini所在目录下的CA.crt证书拷贝到guest os中,然后导入浏览器(本人安装导入到Firefox中)
    1. done!

参考:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment