VirtualBox 安裝CentOS6.5

1)在「命令行模式下」以root身份進入系統
(2)用Vi編輯器對相關文件進行編輯:#vi /etc/inittab
(3)將其中的:init:3修改成:init:5
(4)保存並退出::wq
(5)從新啓動系統:#rebootlinux

 

————————————————設置圖形界面的方式————————————————————————vim

 

1.設置虛擬機使用橋聯方式鏈接宿主機centos

2.修改虛擬機centos上的網卡配置/etc/sysconfig/network-scripts/ifcfg-eth0服務器

[root@localhost  tomener]# vim /etc/sysconfig/network-scripts/ifcfg-eth0編輯器

 

DEVICE=eth0spa

HWADDR=00:0C:29:45:97:65.net

TYPE=Ethernet命令行

UUID=18d76aa8-6142-45fa-98dd-4e0d391fc90crest

ONBOOT=yesthree

NM_CONTROLLED=yes

 

BOOTPROTO=static

NETMASK=255.255.255.0

IPADDR=192.168.1.200

GATEWAY=192.168.1.1

DNS1=8.8.8.8

 

提示:BOOTPROTO的設置,能夠設置爲static 或者 dhcp

3、禁止掉SELINUX

[root@localhost  tomener]# vim /etc/selinux/config

 

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

#SELINUX=enforcing

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

這裏是把SELINUX=enforcing 改成 SELINUX=disabled

 

第四步:重啓network

service network restart

第五步:ping www.baidu.com

[root@localhost  tomener]# ping www.baidu.com

PING www.a.shifen.com (115.239.210.26) 56(84) bytes of data.

64 bytes from 115.239.210.26: icmp_seq=1 ttl=55 time=204 ms

64 bytes from 115.239.210.26: icmp_seq=2 ttl=55 time=119 ms

 

到此,讓在vmware虛擬機上的centos上網,並起和本機通訊就完成了。

若是重啓了network仍是鏈接不上,那麼先關閉服務器,再啓動,不要用重啓試試。

相關文章
相關標籤/搜索