2013. 2. 8. 13:56

Virtualbox

[ index ]


 o Host와 Guest OS간 network 설정

o fedora8 에서 어떤 버전을 설치해야 하나요?
o install guide
o version upgrade
o 폴더 공유하기
o seamless 기능
o usb 동작하기 - vbox1.6.0
o help -  VBoxManage --help
o trouble shooting
o network setting
  o virtualbox에서 GuestAddition 설치 ==
  o shared folder 마운트 하기

[ detailed ]
==  Host와 Guest OS간 network 설정 ==
 a. Host OS
   - Win7, VirtualBox Host-Only Network Adaptor
 a. Guest OS
   - Ubuntu, NAT 모드로 설정되어 있을때 인터넷 접속 정상
 a. Host OS에서 Guest OS로 telnet을 하고자 할때
  - case1 : Network Adaptor를 2개 만들어서 하나는 Bridged Mode로 하나는 Host-Only 모드로 설정한다.
  - case2 : case1에서와 같은 환경에서 NAT 모드와 Host-Only 모드로 하면 어떨까?
  : 이렇게 설정해도 안되는 경우 Host OS와 Guest OS간 ip range를 같게 설정해 준다.
-- --

o fedora8 에서 어떤 버전을 설치해야 하나요?
 1. 3.1.2 버전을 설치하면 shared folder가 read only file system이라고 하면서 write기능이 동작하지 않는다.
  - 이렇게 되면 host os(fedora 8)에서 해당 디렉토리 write도 안되더라.
 2. 아래 usb access 관련해서 /etc/fstab에 설정한 값을 지우라고 경고 메시지가 뜬다.

o install guide
 1. Fedora 8에서 virtualbox 3.1.x 설치
  - 더이상 rpm 파일은 배포되지 않는다.
  - VirtualBox-3.1.6-59338-Linux_x86.run 파일을 root권한 으로 실행시키면 설치&upgrade가 된다.
  # virtualbox.x.bin 파일을 root 권한으로 실행시키면 설치가 된다.
 1. virtualbox를 설치하고
- 실행하는 id를 vobxusers 그룹에 포함시킨다.
- VirtualBox를 실행한 상태에서 
File > Preferences > Input 에서 Host Key를 설정할 수 있다.
- Guest OS를 실행한 상태에서 Devices > Install Guest Additions를 설치한다
: 마우스 지원 및 seamless 기능 지원
o version upgrade
 - remove and reinstall
 - ex) rpm -e virtualbox-xx 
       sh VirtualBox-3.1.2-56127-Linux_x86.run

o 폴더 공유하기
 - 호스트인 xp에서는 다음 명령을 실행합니다. 
예) vboxmanage sharedfolder add "아무개" -name "desktop" -hostpath "c:\어디어디...\바탕 화면" 
뜻: VM이름이 "아무개"인 게스트에 "desktop"이라는 공유이름으로 "바탕화면"을 공유하겠다는 명령입니다. 
 - 게스트에서는 다음 명령을 실행합니다. 
예) net use x: \\vboxsvr\Virtualbox_folder
예) net use y: \\vboxsvr\Mail
예) net use z: \\vboxsvr\atm

o seamless 기능
 - Host_Key + L (한자 + L)

o usb 동작하기
 : Fedora 13에서도 같이 했다.
 1. v3.1.0는 이 설정을 하지 않으면 USB를 사용할 수 없다.
   - virtualbox를 실행하면 이 설정을 삭제하라고 메시지가 뜨더라
 2. 설정하기
  a. Grep vbox /etc/group and check for your vbox user id 
   - vboxusers:x:501:my_id
  b. Open /etc/fstab and Add the following line to the bottom of the file 
   - none /sys/bus/usb/drivers usbfs devgid=501,devmode=664 0 0
     The userid bit is the number you found above step in /etc/group.
   - mount -a
  c. Then I simply restart the virtualbox.
 3. side-effects
  - Virtualbox is often hang on when it start.
  - virtualbox를 실행할 때마다 아래 메시지가 뜬다.
You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers. We strongly recommend that you change this, as it is a severe mis-configuration of your system which could cause USB devices to fail in unexpected ways.
 4. 기타 command
  - vdi를 copy할때는 UUID 문제 때문에 아래 명령을 사용해서 Copy하도록 하자
    : VBoxManage clonevdi 
  - vdi를 copy했는데 UUID가 같아서 사용못하므로 아래 command로 UUID를 바꾸고 VirtualBox.xml에 바뀐 UUID를 넣어준다.
    : VBoxManage internalcommands setvdiuuid WinXP.vdi


o Virtualbox networking mode
 : 각 모드 설명을 보기 위해서는 아래 링크 참조
 http://www.jopenbusiness.com/mediawiki/index.php/Network
 : Host (Fedora 9), Guest(Win2k)
 1. NAT
  a. NAT기능으로 ip를 받아오기 때문에 무난하게 network이 동작한다.
  b. 하지만 외부에서 virtualbox guest os로 접속등은 할수 없다.
 2. Bridged mode
  a. VM(guest os)에서도 별도의 ip를 할당받는다.
  a. 따라서 외부에서 guest os로 접속이 가능하다.(공인 ip를 쓸 경우)
     하지만 NAT는 port forwarding을 하지 않는 이상 외부에서 접속은 안된다.
  a. guest os에서 linux host에서 쓰는 ip대역에 속하는 ip를 한개 설정해 줬다.
     linux에서 ifconfig -a로 보면 vboxnet0에는 ip가 할당 안된것 처럼 보인다?
  a. guest os 또는 linux host가 dhcp server로 부터 ip를 받는 환경인 경우 
    linux host에서 봤을때 아래처럼 별도 ip가 생성된다. 하지만 guest OS에서 보면 physical interface(eth0)에서 가지는 IP 대역을 별도로 가지고 인터넛이 된다.
   - eth0      Link encap:Ethernet  HWaddr 00:E0:xx:xx:xx:xx  
               inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
   - vboxnet0  Link encap:Ethernet  HWaddr 0A:00:27:00:00:00  
               inet addr:192.168.56.1  Bcast:192.168.56.255  Mask:255.255.255.0
  b. guest os(win2k)에서 봤을때 ip
IP Address. . . . . . . . . . . . : 192.168.1.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 68.87.64.146

== virtualbox에서 GuestAddition 설치 ==

 a. 미리 설치되어 있어야는 것들

  - gcc, gcc-c++, make, kernel-devel, kernel-headers 정도 설치해 줘얄듯...

 a. VBoxGuestAdditions.iso 파일 download 후  VBoxLinuxAdditions.run으로 설치


== shared folder 마운트 하기 ==

=== linux guest에서 windows shared folder 설정하기 ===

 a. shared folder 설정에서 sharing할 host의 디렉토리(/temp) 설정

 a. linux guest에서 아래 명령어 실행

  - mount -t vboxsf -iocharset=utf8 temp /mnt/vista/

: http://www.sysprobs.com/setup-virtualbox-shared-folders-fedora-14


=== Windows guest에서 Linux의 Shared Folder 붙이기 ===
 a. net use x: \\vboxsvr\VirtualMachineSharedFolder