dom0 이 올려지고 제대로 실행이 되면 HVM domU 실행을 위해서 가상 디스크와 HVM config 파일이 필요할 것입니다.
HVM domU 에서 솔라리스를 운용하는 것에는 몇가지 제약이 있습니다: 솔라리스 HVM 게스트.
주의 - 윈도우 HVM 도메인은 바이러스나 웜에 걸릴 여지가 있습니다. - 모든 보안 규칙을 준수하시고, 방화벽을 활성화 하고, 안티바이러스 소프트웨어를 설치하고 네트워크를 안전하게 하기 위해 모든 필요한 작업들을 수행 하시기 바랍니다.
도메인에 가상 디스크 생성하기
HVM 도메인에 디스크를 부여하는 방법은 3가지 인증된 방법이 있습니다: lofi-기반 파일, 물리 디스크 파티션, 그리고 ZFS zvols.
lofi(7D) -기반 파일
가장 쉽고 [현재로써] 성능이 가장 좋은 방법은 qemu RAW 이미지 파일을 사용하는 것입니다. 이미지 파일 생성을 위해서는 qemu-img 유틸리티가 필요 합니다. 여러분은 다운로드 공간, 혹은 qemu 를 blastwave 에서 다운로드 합니다. qemu 패키지는 qemu-img 를 /opt/csw/bin 에 설치 합니다.
디스크 생성을 위해서 아래와 같은 커맨드를 실행합니다:
qemu-img create -f raw mydisk.raw 10G
이 명령은 10기가의 qemu 디스크 이미지를 생성합니다. 실제로 디스크 용량은 이 이미지에 쓰여진 데이타를 저장할때 필요한 만큼만 소비 됩니다.
물리적 디스크 파티션
물리 디스크에 남는 파티션이 있다면 이것을 여러분의 HVM 도메인에서 /dev/dsk/cndnpn 로 직접 사용하실 수 있습니다.
ZFS zvol
Tzvol 을 생성하려면 첫번째로 ZFS 풀을 설정 해야 합니다.
zfs create -V 10G mypool/mydisk
위 커맨드를 통해서 /dev/zvol/dsk/mypool/mydisk 경로로 접근 되는 10기가의 가상 디스크가 만들어 집니다.
HVM 도메인 설정 생성하기
설정 예제 파일 을 다운로드 하고 다음의 항목들을 수정 합니다. 이러한 파라미터들의 대부분은 PV 도메인에서 사용하는 것들과 동일 합니다. 예제 파일은 이 문서의 끝에 첨부됩니다.
- 도메인에 할당할 메모리 설정:
memory = 512
- 도메인 이름 부여:
name = "Windows-on-Solaris"
vif라인을 주석해제 처리 해서 도메인에 가상 네트워크 인터페이스 부여 (선택사항):
# Optionally define mac and/or bridge for the network interfaces. # Random MACs are assigned if not given. vif = [ 'type=ioemu' ]
직접 맥 어드레스를 지정하길 원한다면 다음과 같이 설정합니다:
vif = [ 'type=ioemu,mac=00:bb:cc:dd:ee:ff' ]
(맥어드레스를 너무 난수로 설정하지 않도록 주의 하시기 바랍니다 - 특히 16진수의 셋중 제일 첫번째 셋이 설정 되면 이것은 이더넷의 멀티캐스트 어드레스가 되어 버리기 때문에 주의 하셔야 합니다.)
- 도메인에 가상 디스크 지정
블럭 디바이스는 phy: 접두사를 사용합니다; 파일은 file: 접두사를 사용하고 이것은 자동적으로 lofi-마운트가 되도록 합니다. 각각의 디스크는 반드시 특수한 hdx 구분자를 가지고 있어야 합니다. 여기서 'x' 는 드라이브 문자 (a, b, c, 등등 으로 시작함.) 를 의미 합니다. 드라이브 구분자 뒤에 :cdrom 태그는 디스크가 CD 혹은 DVD 드라이브 형태로 나타내어 진다는 것을 의미 합니다.
예를 들어 qemu 이미지를 /export/home/mydisk.raw 에 만들었고 설치 .iso 파일을 /export/home/install.iso 에서 실행하고자 한다면 여러분의 disk 파라미터는 다음과 같을 것입니다:
disk = [ 'file:/export/home/mydisk.raw,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]
물론 여러분은 물리 CD 드라이브를 이용할 수도 있습니다 예를 들어:
disk = [ 'file:/export/home/mydisk.raw,hdc,w', 'phy:/dev/dsk/c2t0p0,hda:cdrom,r' ]
- 부트 디바이스 설정:
boot='d'
이 옵션은 가상 BIOS 가 CDROM ('d') 로 부터 부팅 되도록 합니다. 드라이브로 부터 부팅 시키려면 'c' 를 이용 합니다.
- 그래픽 콘솔을 선택함. VNC 와 libSDL 을 이용함.
libSDL 은 X11 을 이용해서 여러분의 로컬 X 데스크탑에 가상 머신의 그래픽 콘솔을 포함하는 윈도우를 뿌려 줍니다. 여러분은 반드시 원격 X11 디스플레이가 여러분의 데스크탑에서 동작하도록해야 합니다. (즉 DISPLAY 가 제대로 설정 되어야 하고, xhost 가 원격 호스트의 접속을 허용 해야 하고 X 서버가 원격의 접속을 허용하도록 설정되어야 합니다). 원격의 xterm 을 여러분의 데스크탑으로 뿌려주도록 테스트 해보시기 바랍니다.
VNC 는 일반적으로 세션을 파괴하지 않아도 의지에 따라 접속 및 재접속을 할 수 있다는 장점이 존재 합니다. 만약 여러분이 libSDL 콘솔 윈도우를 닫는다면 여러분은 다시는 동일한 세션으로 접속 할 수 없고 반드시 도메인을 재시작 시켜야 할 것입니다 (도메인 계속해서 실행되지 않을 것입니다).
libSDL 을 사용하려면 설정 파일에 옵션을 설정합니다:
#---------------------------------------------------------------------------- # enable SDL library for graphics, default = 0 sdl=1 #---------------------------------------------------------------------------- # enable VNC library for graphics, default = 1 vnc=0
VNC 를 사용하려면 반대로해서 VNC 에 적절한옵션으로 설정 합니다:
#---------------------------------------------------------------------------- # enable SDL library for graphics, default = 0 sdl=0 #---------------------------------------------------------------------------- # enable VNC library for graphics, default = 1 vnc=1
VNC viewer 는 아래와 같은 방법으로 얻어 오실 수 있습니다
java -jar /usr/share/gnome/vino/vino-client.jar VNC_address
여기서 VNC_address 는 hostname:display 입니다.
libSDL 은 여러분의 머신에 이미 존재 합니다.
도메인 생성하기
dom0 에서 X11 출력이 가능한지 확인하시기 바랍니다. 그리고 xm 을 이용해서 도메인의 인스턴스를 생성합니다:
xm create config-example.hvm
콘솔 윈도우가 팝업 으로 뜰 것입니다 (VNC 를 사용하고 vncconsole 옵션을 꺼놓지 않은 이상) 그리고 xm list 커맨드가 여러분의 도메인이 소비하는 CPU 타임을 출력해 주어야 합니다. 만약 도메인이 0.0 CPU 사용량에 머물고 있다면 무언가가 잘못된 것입니다. /var/log/xen 에서 가장 최근에 쓰여진 로그 항목을 확인(ls -lt 가 수정날짜 별로 정렬해 줄 것입니다)해서 문제의 원인을 알아 보시기 바랍니다. qemu-dm 로그 파일은 X11 디스플레이에 문제가 있었는지 혹은 필요한 라이브러리를 찾을 수 없었는지를 가르켜 줄 것입니다. 문제를 해결 하고 (혹은 도움을 요청하고), xm destroy 커맨드를 이용해 도메인을 제거 한 후에 재생성합니다.
만약 libSDL 을 사용하고 있다면 콘솔 윈도우를 클릭하고 (이것은 여러분의 키보드와 마우스를 "붙잡아" 둘 것임), control-alt 를 눌러서 빠져 나갑니다. 이 방법은 여러분의 xmodmap 설정을 무시 합니다 (dvorak 자판 유저들은 조심하시기 바랍니다).
만약 VNC 를 사용 한다면 VNC 마우스 커서와 게스트 OS 에서 뿌려주는 커서 간의 미스매치를 조심하시기 바랍니다. 여러분은 Xen bug #585 워크어라운드를 이용하여 게스트의 마우스 가속을 비활성화 하거나 설정 파일에 다음의 라인을 추가 합니다:
usb=1 usbdevice='tablet'
물론 게스트 OS는 USB 포인터 디바이스를 지원 합니다.
잘 작동하는 설정 파일을 가진 다음에는 xm new 를 이용해서 세이브 할 수도 있고 이후에 xm start 를 통해서 설정 파일 없이도 도메인을 시작시킬 수 있습니다.
만약 VNC 를 이용한다면 VNC 디스플레이 넘버는 설정 파일에 vncdisplay 설정에 관계 없이 항상 0 입니다. 이것은 좀 더 조사가 될 필요가 있습니다.
xm create 에 -c 매개변수를 사용하지 마시기 바랍니다; 솔라리스에서는 HVM 도메인의 시리얼 포트가 아직까지 지원되지 않습니다. 그리고 도메인의 부팅이 실패할 것입니다.
HVM 설정 템플릿
템플릿 파일입니다:
# -*- mode: python; -*-
#============================================================================
# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using 'xm create'.
# You use a separate script for each domain you want to create, or
# you can set the parameters for the domain on the xm command line.
#============================================================================
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
#----------------------------------------------------------------------------
# Kernel image file.
kernel = "/usr/lib/xen/boot/hvmloader"
# The domain build function. HVM domain uses 'hvm'.
builder='hvm'
# Initial memory allocation (in megabytes) for the new domain.
#
# WARNING: Creating a domain with insufficient memory may cause out of
# memory errors. The domain needs enough memory to boot kernel
# and modules. Allocating less than 32MBs is not recommended.
memory = 512
# Shadow pagetable memory for the domain, in MB.
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
shadow_memory = 8
# A name for your domain. All domains must have different names.
name = "Windows-on-Solaris"
# 128-bit UUID for the domain. The default behavior is to generate a new UUID
# on each call to 'xm create'.
#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"
#-----------------------------------------------------------------------------
# the number of cpus guest platform has, default=1
vcpus=1
# enable/disable HVM guest PAE, default=0 (disabled)
#pae=0
# enable/disable HVM guest ACPI, default=0 (disabled)
#acpi=1
# enable/disable HVM guest APIC, default=0 (disabled)
#apic=1
# List of which CPUS this domain is allowed to use, default Xen picks
#cpus = "" # leave to Xen to pick
#cpus = "0" # all vcpus run on CPU0
#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
# Optionally define mac and/or bridge for the network interfaces.
# Random MACs are assigned if not given.
#vif = [ 'type=ioemu' ]
#----------------------------------------------------------------------------
# Define the disk devices you want the domain to have access to, and
# what you want them accessible as.
# Each disk entry is of the form phy:UNAME,DEV,MODE
# where UNAME is the device, DEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.
#disk = [ 'file:/export/home/mydisk.raw,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]
#disk = [ 'phy:/dev/dsk/c1d0p0,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]
#disk = [ 'phy:/dev/zvol/dsk/mypool/mydisk,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]
#----------------------------------------------------------------------------
# Configure the behaviour when a domain exits. There are three 'reasons'
# for a domain to stop: poweroff, reboot, and crash. For each of these you
# may specify:
#
# "destroy", meaning that the domain is cleaned up as normal;
# "restart", meaning that a new domain is started in place of the old
# one;
# "preserve", meaning that no clean-up is done until the domain is
# manually destroyed (using xm destroy, for example); or
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
# The default is
#
# on_poweroff = 'destroy'
# on_reboot = 'restart'
# on_crash = 'restart'
#
# For backwards compatibility we also support the deprecated option restart
#
# restart = 'onreboot' means on_poweroff = 'destroy'
# on_reboot = 'restart'
# on_crash = 'destroy'
#
# restart = 'always' means on_poweroff = 'restart'
# on_reboot = 'restart'
# on_crash = 'restart'
#
# restart = 'never' means on_poweroff = 'destroy'
# on_reboot = 'destroy'
# on_crash = 'destroy'
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'preserve'
#============================================================================
# New stuff
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
#boot="cda"
boot='d'
#-----------------------------------------------------------------------------
# write to temporary files instead of disk image files
#snapshot=1
#----------------------------------------------------------------------------
# enable SDL library for graphics, default = 0
sdl=1
#----------------------------------------------------------------------------
# enable VNC library for graphics, default = 1
vnc=0
#----------------------------------------------------------------------------
# address that should be listened on for the VNC server if vnc is set.
# default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp
vnclisten="0.0.0.0"
#----------------------------------------------------------------------------
# set VNC display number, default = domid
#vncdisplay=1
#----------------------------------------------------------------------------
# try to find an unused port for the VNC server, default = 1
#vncunused=1
#----------------------------------------------------------------------------
# enable spawning vncviewer for domain's console
# (only valid when vnc=1), default = 0
vncconsole=1
vncpasswd=''
#----------------------------------------------------------------------------
# no graphics, use serial port
nographic=0
#----------------------------------------------------------------------------
# enable stdvga, default = 0 (use cirrus logic device model)
stdvga=0
#-----------------------------------------------------------------------------
# serial port re-direct to pty deivce, /dev/pts/n
# then xm console or minicom can connect
#serial='pty'
#serial='stdio'
#serial='file:/tmp/blah'
#serial='/dev/pts/0'
serial='null'
#-----------------------------------------------------------------------------
# enable sound card support, [sb16|es1370|all|..,..], default none
#soundhw='sb16'
#-----------------------------------------------------------------------------
# set the real time clock to local time [default=0 i.e. set to utc]
#localtime=1
#-----------------------------------------------------------------------------
# start in full screen
#full-screen=1
#-----------------------------------------------------------------------------
# Enable USB support (specific devices specified at runtime through the
# monitor window)
#usb=1
# Enable USB mouse support (only enable one of the following, `mouse' for
# PS/2 protocol relative mouse, `tablet' for
# absolute mouse)
#usbdevice='mouse'
#usbdevice='tablet'
이 글의 영문 원본은
How to Set Up an HVM DomU
에서 보실 수 있습니다."오픈솔라리스" 카테고리의 다른 글
- 오픈솔라리스에 썬 웹 스택 설치하기 (댓글 0개 / 트랙백 0개) 2008/10/21
- 오픈솔라리스의 빌드와 설치 (Part 2) (댓글 1개 / 트랙백 0개) 2006/03/23
- VMWare를 이용하여 오픈솔라리스 시작하기 (댓글 1개 / 트랙백 0개) 2006/06/23
- 향상된 리소스 관리 및 존 통합 (댓글 0개 / 트랙백 0개) 2008/06/16
- FAQ: Common Development and Distribution Licens... (댓글 13개 / 트랙백 1개) 2007/08/20
- Indiana 란 무엇이고 어떻게 참여할 수 있나요? (댓글 0개 / 트랙백 0개) 2008/04/17
- 오픈 솔라리스를 위한 무선 네트워킹 (댓글 1개 / 트랙백 0개) 2006/01/23
- 오픈 소프트웨어에 대한 발상의 전환이 필요하다. (댓글 0개 / 트랙백 0개) 2007/12/05
- OpenSolaris 코드 브라우저를 이용하여 코드베이스 탐색하기 (댓글 1개 / 트랙백 1개) 2005/09/23
- Inside OpenSolaris: Introduction to Solaris Dri... (댓글 1개 / 트랙백 0개) 2005/10/23
댓글을 달아 주세요