设为首页 收藏本站
查看: 1173|回复: 0

[经验分享] OpenSolaris 2008.11 Paravirtualized domU on Xen 3.1.2

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-1-9 16:04:11 | 显示全部楼层 |阅读模式
By Tait Clarridgeon February 27, 2009 10:00 AM | Permalink | Comments (0) | TrackBacks (0)

After scouring the internet for a definite solution, I found many. Here is another to add to the list. This is for a paravirtualized Opensolaris 2008.11 domU 64bit.

The system I am using is the most recently updated CentOS 5.2 X86_64 running the CentOS xen package which is v3.1.2 (even though it still says 3.0.4 in the RPM name.. gg CentOS)

First, you will need to create the directory for the opensolaris guest I am using /vm/opensolaris for the purposes of this blog entry.

Next, you can download the Opensolaris 2008.11 Live CD from here.

The fastest way is to go into your vm directory (eg. /vm/opensolaris) and do:

wget http://dlc.sun.com/osol/opensolaris/2008/11/osol-0811.iso

After the file has downloaded you will need to grab the kernel and ramdisk from it.
Mount the iso on /mnt (or any other directory).

mount -o loop,ro /vm/opensolaris/osol-0811.iso /mnt

Once the file is mounted, copy the following files to your opensolaris directory.

cp /mnt/platform/i86xpv/kernel/amd64/unix /vm/opensolaris
cp /mnt/boot/x86.microroot /vm/opensolaris

Now you must setup either a disk image or lvm for the new vm, if you are creating a disk image do:

dd if=/dev/zero of=/vm/opensolaris/root.img bs=1G count=10

This creates a 10GB image for use as the root drive.

Now you must create the initial install config file in the opensolaris directory called opensolaris-install.cfg with the following contents: note that the disk= and extra= lines are split up here, but should all be on one line without the "\"

name = "opensolaris"
vcpus = 1
memory = 1024
kernel = "/vm/opensolaris/unix"
ramdisk = "/vm/opensolaris/x86.microroot"
extra = "/platform/i86xpv/kernel/amd64/unix -B \
console=ttya,livemode=text"
disk = ['file:/vm/opensolaris/osol-0811.iso,6:cdrom,r',\
'file:/vm/opensolaris/root.img,0,w']
vif = ['']
on_shutdown = "destroy"
on_reboot = "destroy"
on_crash = "destroy"

Now you can start the install procedure starting the domU with a console.

xm create -c /vm/opensolaris/opensolaris-install.cfg

You should see the following:

Using config file "/vm/opensolaris/opensolaris-install.cfg".
Started domain opensolaris
v3.1.2-92.1.22.el5 chgset 'unavailable'
SunOS Release 5.11 Version snv_101b 64-bit
Copyright 1983-2008 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: opensolaris
Remounting root read/write
Probing for device nodes ...
NOTICE: xdf@6: failed to read feature-barrier
NOTICE: xdf@0: failed to read feature-barrier
Preparing live image for use
Done mounting Live image
USB keyboard
 1. Albanian                      22. Latvian                      
 2. Belarusian                    23. Macedonian                   
 3. Belgian                       24. Malta_UK                     
 4. Bulgarian                     25. Malta_US                     
 5. Croatian                      26. Norwegian                    
 6. Czech                         27. Polish                       
 7. Danish                        28. Portuguese                   
 8. Dutch                         29. Russian                      
 9. Finnish                       30. Serbia-And-Montenegro        
10. French                        31. Slovenian                    
11. French-Canadian               32. Slovakian                    
12. Hungarian                     33. Spanish                      
13. German                        34. Swedish                      
14. Greek                         35. Swiss-French                 
15. Icelandic                     36. Swiss-German                 
16. Italian                       37. Traditional-Chinese          
17. Japanese-type6                38. TurkishQ                     
18. Japanese                      39. TurkishF                     
19. Korean                        40. UK-English                   
20. Latin-American                41. US-English                   
21. Lithuanian                   
To select the keyboard layout, enter a number [default 41]:

Here you can just press enter to continue if you are using a US keyboard

 1. Chinese - Simplified         
 2. Chinese - Traditional        
 3. English                      
 4. French                       
 5. German                       
 6. Italian                      
 7. Japanese                     
 8. Korean                       
 9. Portuguese - Brazil          
10. Russian                      
11. Spanish                      
To select desktop language, enter a number [default is 3]:

Here you can press enter again for English

User selected: English
Configuring devices.
Mounting cdroms
Reading ZFS config: done.

opensolaris console login:

Now you are at the login prompt for the Live CD. To make the install easier, you can setup a VNC server to connect to for a graphical install.

First, you will need to login with the credentials jack/jack (username/password).

opensolaris console login: jack
Password:
Sun Microsystems Inc.   SunOS 5.11     snv_101b       November 2008
jack@opensolaris:~$

Now that you are logged in, you will have to setup the VNC server. You will need to create a user vnc directory, copy some files, then run the VNC server and setup a VNC password:

jack@opensolaris:~$ mkdir .vnc
jack@opensolaris:~$ cp .Xclients .vnc/xstartup
jack@opensolaris:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /jack/.Xauthority

New 'opensolaris:1 ()' desktop is opensolaris:1

Starting applications specified in /jack/.vnc/xstartup
Log file is /jack/.vnc/opensolaris:1.log


jack@opensolaris:~$

Now you will need to find your ip so you can connect, reminder that you may need to add your xen network bridge in the config file if you don't see an IP.

jack@opensolaris:~$ ifconfig -a

You will be looking for an IP that isn't the loopback, for me the device name was xnf0 and was below lo0 (the loopback).

Now you can VNC from any client to IPADDRESS:1 to get the desktop.

Go through the install steps and wait until you get to the screen that it asks for a reboot. Before rebooting you will need to find the ZFS ID for the bootfs in rpool. Open the terminal in the VNC session (along the top bar) and type:

pfexec zdb -vvv rpool | grep bootfs

You will see a line that appears below that will say:

bootfs = NUMBER

Remember that number as we will need it for the runtime config. Note that after the bootfs line comes up you can press Ctrl+C to cancel out (or you will wait for quite a while).

Now you can restart the VM, when you click restart the opensolaris domain should shutdown.

Check with xm list to see if it has been shutdown then create a new config called opensolaris.cfg in the opensolaris vm directory with the following: note that the extra line is split up here, but should all be on one line without the "\".

name = "opensolaris"
vcpus = 1
memory = 1024
kernel = "/vm/opensolaris/unix"
ramdisk = "/vm/opensolaris/x86.microroot"
extra = '/platform/i86xpv/kernel/amd64/unix -B \
console=ttya,zfs-bootfs=rpool/56,bootpath="/xpvd/xdf@0:a"'
disk = ['file:/vm/opensolaris/root.img,0,w']
vif = ['']
on_shutdown = "destroy"
on_reboot = "destroy"
on_crash = "destroy"


Now this is where the rpool ZFS ID comes in handy. In the extra line you will see that there is an entry that says "bootfs=rpool/56", this is what my ID is so just replace 56 with whatever your ID was.

Now you can create the VM again using the new config

xm create -c /vm/opensolaris/opensolaris.cfg

And that should be it! If you have any questions, please feel free to ask them. I remember having a hard time figuring out issues during boot.

I am not sure how stable this is, but atleast it runs.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-162301-1-1.html 上篇帖子: xen虚拟机的linux系统时间设置 下篇帖子: Virt-install&Virt-manager at Xen 4.0-rc8 (2.6.32.10 pvops) Dom0 on top Ubuntu Ka
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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