LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 611|回复: 0

Windows_XP_Professional_5.1+VirtualBox_for_windows+Red_Hat_Enterprise_Linux_5.

[复制链接]
发表于 2011-8-30 18:06:10 | 显示全部楼层 |阅读模式
下载最新版本且免费免序列号的VirtualBox-4.0.4-70112-Win.exe并安装,安装之前一定要让电脑网卡连接到路由器使它获得IP地址,否则不会出现多一张网卡VirtualBox[/url] Host-Only Network
开始——运行——输入cmd
C:\Documents and Settings\suozhang>ver
Microsoft Windows XP [版本 5.1.2600]
C:\Documents and Settings\suozhang>ipconfig
Windows IP Configuration
Ethernet adapter 本地连接:
        Connection-specific DNS Suffix  . : domain
        IP Address. . . . . . . . . . . . : 192.168.1.100
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
Ethernet adapter VirtualBox Host-Only Network:
        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.56.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :
开始——所有程序——Oracle VM VirtualBox——VirtualBox——新建——名称(a):rhel5,操作系统(S):Linux,版本(V):Red Hat——内存大小(M):256M——勾选Boot Hard Disk,创建新的虚拟硬盘(C)——Storage Type动态扩展(D)——位置(L)输入D:\Backup\VirtualBox,大小(s)为8GB

单击rhel5——单击设置
常规——高级——备份的位置(n)输入D:\Backup\VirtualBox\Snapshots
系统——主板——启动顺序——只勾选光驱不勾选软驱和硬盘
显示——显存大小——32MB
Storage——单击没有盘片——属性——单击CD/DVD Drive 第二IDE控制器主通道右边的光碟图标——Choose a virtual CD/DVD disk file——选择
rhel5-i386-dvd.iso
网络——网络连接1——启用网络连接(E)——连接方式(A):Host-only Adapter——高级——控制芯片(I):Intel PRO/1000 MT Desktop (8254OEM)——勾选接入网线
网络——网络连接2——启用网络连接(E)——连接方式(A):NAT——高级——控制芯片(I):Intel PRO/1000 T Server (82543GC)——勾选接入网线
第一个网卡用于主机ssh到客户机或主机桌面远程连接到客户机,以方便直接控制客户机,而第二个网卡客户机通过主机连接上互联网,两个网卡最好使用不同的芯片方便Linux系统识别也方便自己识别区分
数据空间——数据空间列表——单击访问权限右边的文件夹图标——数据空间位置输入D:\Backup\VirtualBox\vboxsf——确定
单击rhel5——单击开始
把客户系统Red Hat Enterprise Linux Server release 5.1 (Tikanga)安装好,一定要勾选软件开发和网络服务
单击rhel5——单击控制——Create Shortcut on Desktop
复制桌面的rhel5快捷方式到C:\Documents and Settings\suozhang\「开始」菜单\程序\启动

设备——分配光驱——Choose a virtual CD/DVD disk file——选择
C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso

mkdir /mnt/iso
mount /dev/cdrom /mnt/iso
cp -ar /mnt/iso /root
vim /root/iso/autorun.sh
/gksu
删除gksu
bash /root/iso/autorun.sh
[root@localhost vboxadditions]# ./autorun.sh
Verifying archive integrity... All good.
Uncompressing VirtualBox 3.2.12 Guest Additions for Linux........
VirtualBox Guest Additions installer
Uninstalling old VirtualBox DKMS kernel modules            [确定]
Building the VirtualBox Guest Additions kernel modules
Your guest system does not seem to have sufficient OpenGL support to enable
accelerated 3D effects (this requires Linux 2.6.27 or later in the guest
system).  This Guest Additions feature will be disabled.

Building the main Guest Additions module                   [确定]
Building the shared folder support module                  [确定]
Doing non-kernel setup of the Guest Additions              [确定]
Starting the VirtualBox Guest Additions                    [确定]
Installing the Window System drivers
Installing X.Org 7.1 modules                               [确定]
Setting up the Window System to use the Guest Additions    [确定]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services componen[确定]

mkdir /mnt/vboxsf
cat /etc/fstab
vboxsf /mnt/vboxsf vboxsf defaults,gid=suozhang,uid=suozhang 0 0

以root登录并startx
最大化窗口——控制——自动调制显示尺寸
系统——首选项——屏幕分辨率——得到最佳值1366x671

vim /etc/sysconfig/vncservers
VNCSERVERS="0:suozhang"
VNCSERVERARGS[0]="-geometry 1366x671 -depth 16"
VNCSERVERS="1:suozhang"
VNCSERVERARGS[1]="-geometry 1366x671 -depth 16"
VNCSERVERS="2:suozhang"
VNCSERVERARGS[2]="-geometry 1366x671 -depth 16"
0号就是本地Ctrl+Alt+F7使用了,所以通常是从1开始,端口也是从5901开始;颜色质量16已经够用,若24就占用一些宽带
VNCSERVERS="0:suozhang"对应端口为5900
VNCSERVERS="1:suozhang"对应端口为5901
VNCSERVERS="2:suozhang"对应端口为5902
su -l suozhang
vncpasswd << 'EOF'
> 123456
> 123456
> EOF

ls ~/.vnc
自动创建~/.vnc文件夹
service vncserver start
自动创建xstartup文件
vim ~/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
# xsetroot -solid grey
# vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# twm &
gnome-session &
或者
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
# xsetroot -solid grey
# vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# twm &
startx &
service vncserver restart
chkconfig vncserver on
每次修改xstartup文件后都要service vncserver restart

vim /etc/sysconfig/iptables       
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
系统——管理——安全级别和防火墙——防火墙选项——信任服务勾选SSH——其它端口——添加——端口5901和协议为tcp
service iptables restart

http://www.realvnc.com/cgi-bin/d ... wer.exe和putty.exe
开始——控制面板——网络和Internet连接——Windows防火墙——例外——添加程序——浏览——找到vnc-4_1_3-x86_win32_viewer.exe和putty.exe——确定——确定

双击vnc-4_1_3-x86_win32_viewer——在Server右边输入192.168.56.101:0——单击Options——Colour & Encoding——Colour level——Full(all available colour)——OK——输入vncpasswd设置的密码——右击窗口最上面的蓝条——Options——Load/Save——Save As——选择Yes保存密码

双击putty.exe——
Session——Host Name(or IP address)输入客户机的IP地址——Load save or delete a stored session——Saved Sessions输入rhel5
Window——Appearance——Font settings——Change——大小选择16——确定
Window——TranslationWindow——Received data assumed to be in which character set选择UTF-8
Session——Load save or delete a stored session——Saved Sessions输入rhel5——Save——Open——选择Yes接受远程服务器的指纹
下载使用putty.exe时只要双击rhel5就可以使用刚才的设置了

不必经常关闭rhel51的,只需
单击控制——暂停
单击控制——退出——快速休眠

这是我去年底做的文章,详细记录方便自己查看,一直都没有发表出来,现在给大家参考一下,目的是让windows和linux同时运行同时上网,让鼠标在两者之间切换不再需要Ctrl+Alt或Ctrl,都能快速启动和关闭,方便学习测试网络和防火墙
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表