`

Linux Host + windows guest

阅读更多

一 适用人群:
大部分时间工作于linux上,有时不得已要用windows里的功能,但机器不能重启(比如http服务在运行)

二 优点:
1。linux运行在硬件的native speed上而不是虚拟机
2。发挥linux的稳定性
3。可以使用linux防火墙来保护windows虚拟机,过滤(和监视)已知和未知的各种病毒(木马)。
3。进行proxy/dhcp/dns/nat/ipfilter的实验,提高应用水平,或原型开发。

三 具体配置

1。安装vmware workstation 4.0/or 4.5.
2. 如果vmware发行盘中没有对你的kernel的支持,需要编译新的模块。
你需要安装kernel-source和gcc的编译器。
执行: sudo vmware-config.pl

编译以后配置网络,只要选host-only这种类型就行了,
指定网络:(例如)10.1.1.0
netmask: 255.255.255.0
另外不要选择vmware的samba来进行文件共享。


3。完成后,vmware服务应该已经启动,查一下网络接口
/sbin/ifconfig 
应该应该有一个虚拟的接口:
vmnet1

4. 以普通用户执行
vmware
创建windows 2000/XP的guest虚拟机,注意,网络类型选host-only.

5. 使用host里的dhcpd 
查一下进程
ps -ef | grep vmware
你会发现vmware 在虚拟的接口上启用了自己的dhcp服务,为了使用host里的dhcp服务,必须将其停掉。
方法1:kill 掉这个进程
方法2:编辑这个文件:/etc/init.d/vmware,找到这一行:
vmware_start_hostonly "$vHubNr" 'vmnet'"$vHubNr" \
                    "$hostaddr" "$netmask" 'yes' "$samba"
将'yes'换成'no',这样vmware服务启动时就不会加载自带的dhcp服务。
重新启动vmware服务
sudo /sbin/service vmware restart


6. 配置iptables和dhcpd
到现在,你已经得到了一个有多网络接口的机器和一个虚拟的内网,现在可以为这个虚拟的内网配置dhcp和防火墙了。
dhcpd:
编辑:/etc/sysconfig/dhcpd
DHCPDARGS="eth1 vmnet1"
eth1是原来的一个内网的网卡(如果有的话),vmnet1是虚拟内网的网卡。
编辑:/etc/dhcpd.conf
default-lease-time 259200;
max-lease-time 518400;
                                                                                
option domain-name "你的domain";
option domain-name-servers 你的DNS(用逗号分隔);
ddns-update-style ad-hoc;
                                                                                
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.9 10.1.1.100;
option broadcast-address 10.1.1.255;
option routers 10.1.1.1;
option netbios-name-servers 运行wins的服务器地址;
}
subnet 10.1.2.0 netmask 255.255.255.0 {
range 10.1.2.9 10.1.2.100;
option broadcast-address 10.1.2.255;
option routers 10.1.2.1;
option netbios-name-servers 运行wins的服务器地址;
}

上面的例子中vmnet1的address: 10.1.1.1,netmask: 255.255.255.0
eth1(原来的内网网卡)10.1.2.1,netmask 255.255.255.0

然后配置防火墙,打开ip forwad, NAT,参见其他帖子

7. 配置虚拟的WindowsXP, 网络可以选择dhcp, 这样,IP 和网关以及DNS都直接获取.当然可以手工设置,以上为例,手工设置为:
IP: 10.1.1.x
DNS:your dns
gateway 10.1.1.1

完成:
你现在就拥有了一个带有内网的linux,可以进行各种实验了,如samba, squid 等.

总结:
在vmware的使用手册中,直接连到外网 的方法是使用bridge,以上的方法是使用host-only这个方法,然后利用host的各种服务来建立一个完善的网络系统,这样,guest OS的网络连接就得到了完全的控制.

体会:
vmware作为一个虚拟机,不可避免的使用大量的资源,所以没事的时候不要开着虚拟机. 
分享到:
评论

相关推荐

    如何在linux系统的host上安装windows系统的guest

    本文将介绍如何在Linux系统的host上安装windows系统的guest,这里以win7-32系统为例进行介绍,然后在文章底部给大家补充讲解如何在Linux系统虚拟机中安装Windows系统,具体内容详情通过本文一起学习吧

    Windows与Vmware下的Linux文件共享方式总结

    Windows和Linux间有很多文件共享的方式,这里总结了一下。假设你的Host计算机是Windows,Guest是Linux

    最全面的Vmware网络配置

    最全面的Vmware网络配置:很多朋友用了vmware来操练linux,基本的模式是windows host + linux guest,这个方法对于演练linux的初学者来说不失为好方法,但对于真正天天使用linux的人,如果他/她想使用windows里的...

    vmtools-linux.iso

    Build Host: x8664-build.centos.org Before reporting problems, check http://wiki.X.Org to make sure that you have the latest version. Module Loader present OSKernel: Linux version 2.6.9-34.EL ...

    ug1169-xilinx-qemu.pdf

    This system-emulation-model runs on an Intel-compatible Linux or Windows host systems. To use this system emulation model you must be familiar with: • Device architecture • GDB for remote ...

    Linux操作系统基础教程

    Linux的核心具有 Windows 无法比拟的稳定性和高效率,在不使用 X Windows 的情况 下,它占用系统资源较少,可以使一台 Intel486摇身一变成为高效工作站。对于想要学习 UNIX的用户来说,使他们熟悉 UNIX 操作环境,...

    Virtualbox主机和虚拟机之间文件夹共享及双向拷贝(Windows-Windows, Windows-Linux)

    最近学习Virtualbox的一些知识,记录下,Virtualbox下如何实现主机和...Guest操作系统:Windows Server 1.首先设置共享文件夹 2.虚拟机中的菜单项中,设备 – 分配光驱 – 选择一个虚拟光盘。在弹出的对话框选择 Virt

    bochs user manual 单html文件+pdf 英文原版

    8.11.4. Set up the private network between the host and the guest 8.11.5. Set up the host to masquerade the guest network accesses 8.12. Using the 'slirp' networking module 8.12.1. Advanced Slirp ...

    PetaLinux 2014.4 Linux Image with Custom IP UIO Driver

    This document describes how to create, test and configure a Linux image... Ubunto 14.04 LTS (64-bit) Guest is running Oracle VM VirtualBox 4.3.20 on a Windows 7 Professional Service pack 1 (64-bit) Host.

    cmd操作命令和linux命令大全收集

    at ip time 程序名(或一个命令) /r 在某时间运行对方某程序并重新启动计算机 finger username @host 查看最近有哪些用户登陆 telnet ip 端口 远和登陆服务器,默认端口为23 open ip 连接到IP(属telnet登陆后的...

    syncClipboardWinGuestAndLinuxHost

    Linux 宿主机运行./host.shlinux 下编译 hostgo get github.com/atotto/clipboardgo get github.com/syyongx/php2gogo build -o host-linux host.goWin 虚拟机双击运行guest.batwin下编译 guestgo

    Qemu-1.0.1 for windows

    -usbdevice name add the host or guest USB device 'name' -device driver[,prop[=value][,...]] add device (based on driver) prop=value,... sets driver properties use -device ? to print all possible ...

    qemu-0.13.0(编译过全处理器支持)

    -usbdevice name add the host or guest USB device 'name' -device driver[,prop[=value][,...]] add device (based on driver) prop=value,... sets driver properties use -device ? to print all possible ...

    vmware unlocker 2.0.6最新版(vm虚拟机破解安装Mac OS)

    Workstation 11 on Windows and Linux Player 7 on Windows and Linux Fusion 7 on Mavericks and Yosemite ESXi 6.0 The patch code carries out the following modifications dependent on the product being...

    Vivado 2014.4 Linux Basic System with Custom IP

    This document describes how to build a Processor System (... Ubunto 14.04 LTS (64-bit) Guest is running Oracle VM VirtualBox 4.3.20 on a Windows 7 Professional Service pack 1 (64-bit) Host.

    macOS Unlocker 2.1 for VMware Workstation 11/12/14(VM14破解补丁)

    * Workstation Player 7/12/14 on Windows and Linux * Fusion 7/8/10 on Sierra * ESXi 6.5U1 The patch code carries out the following modifications dependent on the product being patched: * Fix vmware-...

    VMwareTools-9.9.5-3735633.tar.gz

    Host 系统: Windows10 64 bit; WMware Player安装在Windows10上 Guest 系统: Ubuntu 16.04.1 LTS, 64 bit 亲测可用。 ====================== 其他版本: - 9.6.2: ...

    VirtualBox 共享文件夹设置及开机自动挂载详细教程

    系统装好了,在日常使用过程中,往往要从VirtualBox的客户机(guest system)中使用主机(host system)里面的文件,那么通过共享文件夹的方式可以达成此目的。 我在这里写了个图文教程,说明设置过程,希望对大家...

    VirtualBox 共享文件夹权限设置及使用方法

    主机(host):windowsXP 虚拟机:VirtualBox 客户机 (guest):slackware/ubuntu/…  看过我上一篇写的为VirtualBox 安装additions的朋友应该很清楚,设置VirtualBox共享文件夹之前需要安装VirtualBox Guest ...

    VMwareTools-10.1.5-5055693.tar.gz

    Host 系统: Windows10 64 bit; Guest 系统: Ubuntu 16.04.1 LTS, 64 bit 亲测可用。 ====================== 其他版本: - 9.9.5: http://download.csdn.net/detail/jiaoxiaogu/9715774 - 9.6.2: ...

Global site tag (gtag.js) - Google Analytics