FREEDOM. FRIENDS. FEATURES. FIRST.
페도라 한국 사용자 모임

UML(UserMode Linux) 사용방법

게시판 Tech/Tip UML(UserMode Linux) 사용방법

  • This topic has 1개 답변, 2명 참여, and was last updated 11 years 전에 by ELem. This post has been viewed 24 times
  • 만든이
    게시글
  • #12050
    인베인
    참가자
    • 게시글141
    • 댓글379
    • 총합520
    • ★★
    @leemgs

    User-mode Linux (UML) allows multiple virtual Linux systems (known as guests) to run as an application within a normal Linux system (known as the host). As each guest is just a normal application running as a process in user space, this approach provides the user with a way of running multiple virtual Linux machines on a single piece of hardware, offering excellent security and safety without affecting the host environment's configuration or stability.

    0. Related Website
    http://user-mode-linux.sourceforge.net/
    http://www.crashcourse.ca/wiki/index.php/User_Mode_Linux_on_Fedora

    1. UML Utilities 설치하기
    ( uml_net, uml_mconsole, uml_switch, tunctl, )

    fc6#> echo "p7KeCa" > ~/.uml
    fc6#> dmesg | grep mconsole
    mconsole (version 2) initialized on /home/rpjday/.uml/p7KeCa/mconsole
                                                         ^^^^^^ there it is again
    fc6#> yum install fuse-devel
              (http://fuse.sf.net  : File System in Userspace (FUSE) libraries)
    fc6#> w g e t http://user-mode-linux.sourceforge.net/uml_utilities_20070815.tar.bz2
    fc6#> bunzip2 uml_utilities_20070815.tar.bz2
    fc6#> tar xf uml_utilities_20070815.tar
    fc6#> cd tools-20070815/
    fc6#> make all
    fc6#> make BIN_DIR=/usr/local/bin install
    fc6#> ls /usr/local/bin/uml*
    /usr/local/bin/uml_mconsole  /usr/local/bin/uml_net    /usr/local/bin/uml_mkcow    
    /usr/local/bin/uml_switch       /usr/local/bin/uml_moo  /usr/local/bin/uml_watchdog
    /usr/local/bin/uml_mount
    fc6#> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    2. UMLKernel 설치하기
    fc6#> w g e t http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2
    fc6#> unzip2 linux-2.6.24.tar.bz2
    fc6#> tar xf linux-2.6.24.tar
    fc6#> cd linux-2.6.24
    fc6#> make defconfig ARCH=um
    fc6#> make menuconfig ARCH=um
    fc6#> make mrproper
    fc6#> make mrproper ARCH=um
    fc6#> make ARCH=um
    fc6#> ls -l linux
    fc6#> file linux
    linux-2.6.24: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
    for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

    3. Getting Started
       * HOST-side: 192.168.1.254
       * UML-side: 192.168.1.253
    fc6#> w g e t http://user-mode-linux.sourceforge.net/linux-2.6.24-rc7.bz2
    fc6#> w g e t http://uml.nagafix.co.uk/FedoraCore5/FedoraCore5-x86-root_fs.bz2
    fc6#> bunzip2 linux-2.6.24-rc7.bz2 FedoraCore5-x86-root_fs.bz2
    fc6#> chmod 755 ./linux-2.6.24-rc7
    fc6#> uml_mconsole p7KeCa config eth0=tuntap,,,192.168.1.254
    fc6#> ./linux-2.6.24-rc7 ubda=FedoraCore5-x86-root_fs mem=128M eth0=tuntap,,,192.168.1.254
                Fedora Core release 5 (Bordeaux)
                Kernel 2.6.19-rc7 on an i686
                localhost login: root  (no password)
              [UML]#
              [UML]# halt
              [UML]#  
              [UML]# ifconfig eth0 192.168.1.253 up
              [UML]# ifconfig eth0
              [UML]# route add default gw 192.168.1.254
              [UML]# route
              [UML]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
              [UML]# service network {start,stop,restart,status}
              [UML]# chkconfig --add network
              [UML]# chkconfig --list
              [UML]# df
                         Filesystem           1K-blocks      Used Available Use% Mounted on
                         /dev/ubda              1548144    409196   1060308  28% /
                         tmpfs                   786432         0    786432   0% /tmp
              [UML]# mount
                         /dev/ubda on / type auto (rw)
                         none on /proc type proc (rw)
                         none on /dev/pts type devpts (rw,gid=5,mode=620)
                         tmpfs on /tmp type tmpfs (rw,size=768M)
              [UML]#
              [UML]#
    fc6#> ifconfig tap0

    fc6#>

    4. gdb(or ddd)으로 UML Kernel  Debugging하기
    http://user-mode-linux.sourceforge.net/old/UserModeLinux-HOWTO-11.html

    fc6#> ddd ./linux-2.6.24-rc7 ubda=FedoraCore5-x86-root_fs mem=128M eth0=tuntap,,,192.168.1.254

    * 오픈소스는 Open Innovationa & 윈윈전략을 도모할 지언정 절대 공짜(무료)임을 뜻하지 않는다.치

0 답변 글타래를 보이고 있습니다
  • 글쓴이
    답변
    • #12609
      ELem
      참가자
      • 게시글67
      • 댓글672
      • 총합739
      • ★★
      @Bardisch

      ㅤㄲㅑㄲ 이거 쓰면 VM놀이가 더 재밌어지려나 -ㅅ-

0 답변 글타래를 보이고 있습니다
  • 답변은 로그인 후 가능합니다.