免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 9135 | 回复: 8
打印 上一主题 下一主题

[FreeBSD] 我用Microsoft Hyper-V安装了FreeBSD9.0 [复制链接]

论坛徽章:
1
双子座
日期:2013-11-14 17:43:24
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-07-11 15:13 |只看该作者 |倒序浏览
本帖最后由 star_in_sky 于 2012-07-11 15:15 编辑

虚拟机真是个好东西 部门内部有一台HP Server(1U),上面安装了Win2008,配置了Microsoft Hyper-V;安装了两台Win2003的虚拟机,作为部门内部的开发测试平台(WEB+DB)。

嘻嘻,我偷偷的在Hyper-V中又安装了FreeBSD9.0,作为一个学习平台。Microsoft的虚拟机非常不错,FreeBSD已经顺利的运行起来了。
现在发现有三个问题
1)因为驱动的原因,FreeBSD只能用Hyper-V的老式虚拟的网卡,导致远程登录速度比较慢。好消息是,Microsoft很快就会在Hyper-V中增加对FreeBSD的支持。
2)开机不能够自动用dhclient抓取IP地址;必须手动的运行dhclient命令才行。
3)我不能通过GDM远程登录FreeBSD的图形终端;后来改用KDM就可以。

下面是两个截图

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
2 [报告]
发表于 2012-07-11 15:24 |只看该作者
感谢分享 赞! ^_^

论坛徽章:
0
3 [报告]
发表于 2012-07-11 17:10 |只看该作者
不错哈。。。。。。顶你一下。

论坛徽章:
0
4 [报告]
发表于 2012-07-11 17:49 |只看该作者
要想开机自动dhclient,就在/etc/rc.conf添加
  1. background_dhclient="YES"
复制代码

论坛徽章:
1
双子座
日期:2013-11-14 17:43:24
5 [报告]
发表于 2012-07-12 10:29 |只看该作者
回复 4# oily1314


    谢谢楼上的各位。

不过这样的方法也无法自动抓取IP地址,原因还是因为Hyper-V的网卡对于FreeBSD来说不太兼容。

有个老外和我遇见的问题一样。
http://cncc.bingj.com/cache.aspx ... h-CN&w=8e4166db,1f5409a7

FreeBSD under Hyper-V
OK.  I'm playing with FreeBSD 8.0 under Hyper-V R2.  I looked at FreeBSD 7.0 under Hyper-V R1 about this time last year and without a kernel patch, it had issues shutting down (and starting, and running...).  Well, the shutdown bug and the starting bug and all others seem to have been addressed fully aside from one slight networking issue.  So here's the lowdown on this one remaining issue...

As there's no synthetic network adapter driver for the "good" NIC in Hyper-V for FreeBSD (nor OpenBSD nor Linux), then you need to use the "bad" NIC - the Legacy Network Adapter.  The issue with this is that it is slow - only 100 Mbps.  Under FreeBSD it is detected as a "de" NIC - the first one being "de0".

You can either configure this during the initial setup of FreeBSD using sysinstall, or by manually editing the /etc/rc.conf file and adding ifconfig_de0="DHCP" to that file.

There seems to be an issue with the way Microsoft built this adapter as under FreeBSD it doesn't properly obtain a DHCP-assigned address no matter where the DHCP server is - on a Windows box, a *nix box or a firewall/router/modem device.  Real, physical "de" NICs work fine.  At least there's a workaround that allows the DHCP-assigned address to work - you need to stop, start and re-acquire the DHCP-assigned address by running:

ifconfig de0 down
ifconfig de0 up
dhclient de0

Now, you can run this manually every time after you reboot the box, however that means that the box is offline until you log into it using Hyper-V Manager.  A better way to handle this is to create an /etc/rc.local file, add these commands to it, then chmod 755 /etc/rc.local to make it an executable file for root.

Obviously, once this has been done, a portsnap fetch then portsnap extract is a good idea.  (Or whatever way you want to keep your FreeBSD ports up to date.)  And then installing any updated portss that are available using ports, portmanager or portupgrade or whatever method floats your boat.

Regards,

The Outspoken Wookie

论坛徽章:
0
6 [报告]
发表于 2014-05-20 10:24 |只看该作者
楼主所说的前面两个问题我昨天安装freebsd 10.0时都遇到了。
在hyper-v中,默认使用“网络适配器”,在freebsd中运行ifconfig根本就看不到网卡;使用“旧版网络适配器”才可以识别到网卡(de0);
但是在安装过程中不能自动获取到IP地址,启动后也是不能获取到,当时ping 127.0.0.1,判断网卡工作正常,只是没有获取IP。
今天早晨搜索到这篇文件,得到印证,尝试用dhclient命令,可以顺利获取到IP。
准备按照老外的方法,以在启动时可以自动获取IP地址。

论坛徽章:
0
7 [报告]
发表于 2014-05-20 10:53 |只看该作者
刚刚试过了,把下面三条命令做成一个文件/ect/rc.loca
ifconfig de0 down
ifconfig de0 up
dhclient de0
再执行下面的命令,即可让系统在启动时获取到IP地址,确实有效。
chmod 755 /etc/rc.local

论坛徽章:
20
CU大牛徽章
日期:2013-04-17 11:48:26羊年新春福章
日期:2015-03-10 22:39:202015年中国系统架构师大会
日期:2015-06-29 16:11:282015亚冠之平阳省
日期:2015-07-31 09:19:042015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-09-30 06:20:002015亚冠之柏太阳神
日期:2015-10-19 20:29:5915-16赛季CBA联赛之天津
日期:2016-11-29 14:03:4315-16赛季CBA联赛之北控
日期:2016-12-24 20:51:492015年辞旧岁徽章
日期:2015-03-03 16:54:15双鱼座
日期:2015-01-12 20:58:532014年中国系统架构师大会
日期:2014-10-14 15:59:00
8 [报告]
发表于 2014-05-31 07:32 |只看该作者
还可以这么玩,学习了

论坛徽章:
154
2022北京冬奥会纪念版徽章
日期:2015-08-07 17:10:5720周年集字徽章-年
日期:2022-10-26 16:44:2015-16赛季CBA联赛之深圳
日期:2022-11-02 14:02:4515-16赛季CBA联赛之八一
日期:2022-11-28 12:07:4820周年集字徽章-20	
日期:2023-07-19 08:49:4515-16赛季CBA联赛之八一
日期:2023-11-04 19:23:5115-16赛季CBA联赛之广夏
日期:2023-12-13 18:09:34
9 [报告]
发表于 2014-05-31 11:26 |只看该作者
linux才是未来,
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP