Windows7+VirtualBox+Ubuntu本地开发环境搭建

时间:2021-12-14 03:55:33

首先下载相应的VirtualBox和Ubuntu镜像文件

安装Ubuntu操作系统

一 网络设置

将虚拟机的network连接模式设置为Bridge模式,注意无线网卡要与本机的无线网卡名称一致

在windows中适用ipconfig/all查看本地无线网络的如下信息子网掩码

默认网关

DNS服务器列表

在ubuntu系统中编辑文件/etc/network/interfaces,加入

auto enp0s3

iface enp0s3 inet static

address 10.234.50.0 #ip地址

netmask 255.255.254.0

network 10.234.50.0

gateway 10.234.50.1

dns-nameservers xx.xx.xx.xx

dns-nameservers xx.xx.xx.xx

dns-nameservers xx.xx.xx.xx

代理设置

在ubuntu图形界面中选择System Settings->Network->Network Proxy,并填入代理服务器的信息

安装telnet

sudo apt-get install telnetd

sudo apt-get install xinetd

sudo vi /etc/inetd.conf 并加入以下一行

telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd

输入sudo vi /etc/xinetd.conf并加入内容:

# Simple configuration file for xinetd

#

# Some defaults, and include /etc/xinetd.d/

defaults

{

# Please note that you need a log_type line to be able to use log_on_success

# and log_on_failure. The default is the following :

# log_type = SYSLOG daemon info

instances = 60

log_type = SYSLOG authpriv

log_on_success = HOST PID

log_on_failure = HOST

cps = 25 30

}

includedir /etc/xinetd.d

sudo vi /etc/xinetd.d/telnet(文件可能不存在)并加入以下内容:

# default: on

# description: The telnet server serves telnet sessions; it uses \

# unencrypted username/password pairs for authentication.

service telnet

{    

disable = no

flags = REUSE

socket_type = stream

wait = no

user = root

server = /usr/sbin/in.telnetd

log_on_failure += USERID

}

重启网络服务sudo /etc/init.d/xinetd restart

设置apt代理服务器

编辑/etc/apt/apt.conf,,并添加

Acquire::http::proxy "http://username:password@proxyhost:proxyport/"

安装JRE

sudo apt-get install default-jre

安装FTP server

sudo apt-get install vsftpd

修改/etc/vsftpd.conf增加写权限