免费注册 查看新帖 |

Chinaunix

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

[VMware] Installing OpenBSD on VMware Server [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-18 23:11 |只看该作者 |倒序浏览
Many people collect things as a hobby. I collect computers. Over the years, as my collection grew, my living room began to look like a data center. As soon as VMware Server became freely (as in beer) available I knew I had to migrate my servers and development boxes to virtual machines (VM). The problem is that most of my servers run OpenBSD, which is not officially supported by VMware. Out of the box, VMware can't properly shut down OpenBSD VMs; it just powers VMs off, causing data corruption. With a little bit of hacking, I managed to eliminate this issue. Here's how you can install OpenBSD as a guest OS under VMware Server, and possibly other VMware products.
VMware Server supports FreeBSD as a guest OS and offers vmware-tools built for it. You can fool VMware Server into thinking that an OpenBSD VM is FreeBSD, and use OpenBSD's FreeBSD emulation to run vmware-tools.
Create a new VM and select Other/FreeBSD as the guest operating system. Configure the rest to your liking. Power on the VM you've just created and install OpenBSD as usual; if you've never installed OpenBSD before have a look at the Installation Guide. After the installation finishes, reboot into OpenBSD and enable FreeBSD emulation by issuing sysctl -w kern.emul.freebsd=1. Make this setting permanent by uncommenting the appropriate line in /etc/sysctl.conf.
Select Install VMware Tools... on the VM menu; this creates a virtual CD-ROM image which is accessible from the VM and includes a tarball with vmware-tools for FreeBSD. From that tarball we need to install the vmware-guestd daemon, which triggers events sent for the host computer and runs commands accordingly -- such as halt and reboot -- on the guest OS. So, run the following commands to mount that image and install the daemon and its configuration:
mount /dev/cd0c /mnt
tar -zxvpf /mnt/vmware-freebsd-tools.tar.gz -C /tmp
mkdir -p /emul/freebsd/sbin
install -m 555 -o root -g wheel /tmp/vmware-tools-distrib/lib/sbin32/vmware-guestd /emul/freebsd/sbin
cp -r /tmp/vmware-tools-distrib/etc /etc/vmware-tools
rm -rf /tmp/vmware-tools-distrib
umount /mnt
Start the daemon with /emul/freebsd/sbin/vmware-guestd --background /var/run/vmware-guestd.pid --halt-command "/sbin/shutdown -p -h now". To have it started on boot add the following lines to your /etc/rc.local file just before the echo '.' line:
if [ -x /emul/freebsd/sbin/vmware-guestd ]; then
        echo -n ' vmware-tools'
        /emul/freebsd/sbin/vmware-guestd --background /var/run/vmware-guestd.pid \
                --halt-command "/sbin/shutdown -p -h now"
fi
Now you can shut down the VM and check its status from the VMware Web-based management interface or console and have it halt and power off properly.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28922/showart_324001.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP