个人工具

“UbuntuHelp:UserModeLinux”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/UserModeLinux}}
 
{{From|https://help.ubuntu.com/community/UserModeLinux}}
 
{{Languages|UbuntuHelp:UserModeLinux}}
 
{{Languages|UbuntuHelp:UserModeLinux}}
 +
<<Include(Tag/ContentCleanup)>>
 +
<<Include(Tag/NeedsExpansion)>>
 +
=== Getting Started ===
 +
This page will help you get started using User-Mode Linux with Ubuntu. Guide is created for Hardy LTS, but will most likely work with other releases:
 +
The first thing we need is to install the uml kernel and utilities we will need.
 +
<pre><nowiki>
 +
sudo apt-get install user-mode-linux uml-utilities bridge-utils
 +
</nowiki></pre>
 +
The next step is getting us a nice ubuntu hardy filesystem:
 +
<pre><nowiki>
 +
dd if=/dev/zero of=uml-root-hardy bs=4096 seek=1M count=1
 +
mkfs.xfs uml-root-hardy
 +
sudo mount -o loop uml-root-hardy /mnt
 +
sudo apt-get install debootstrap
 +
sudo debootstrap --arch amd64 hardy /mnt http://us.archive.ubuntu.com/ubuntu
 +
sudo echo "/dev/ubd0    /    xfs    defaults    0 1" > /mnt/etc/fstab
 +
sudo echo "proc  /    proc    proc    defaults    0 0" >> /mnt/etc/fstab
 +
sudo mknod --mode=660 /mnt/dev/ubd0 b 98 0
 +
sudo chown root:disk /mnt/dev/ubd0
 +
sudo echo "127.0.0.1 localhost" /etc/hosts
 +
sudo echo "auto lo \
 +
iface lo inet loopback \
 +
auto eth0 \
 +
iface eth0 inet dhcp" > /mnt/etc/network/interfaces
 +
sudo echo "tty0" >> /mnt/etc/securetty
 +
sudo echo "ttys/0" >> /mnt/etc/securetty
 +
 +
sudo rm /mnt/etc/event.d/tty2
 +
sudo rm /mnt/etc/event.d/tty3
 +
sudo rm /mnt/etc/event.d/tty4
 +
sudo rm /mnt/etc/event.d/tty5
 +
sudo rm /mnt/etc/event.d/tty6
 +
sudo rm /mnt/etc/udev/rules.d/75-persistent-net-generator.rules
 +
</nowiki></pre>
 +
Basically what we've done is created an empty filesystem, mounted it, and made some changes that we want done on all our vm's.
 +
We should be ready to run our new vm now:
 +
<pre><nowiki>
 +
linux ubd0=uml-root-hardy.cow1,uml-root-hardy umid=uml1
 +
</nowiki></pre>
 
'''User-Mode Linux''' is another virtualisation technique for running [[UbuntuHelp:VirtualMachines|VirtualMachines]] under GNU/Linux.
 
'''User-Mode Linux''' is another virtualisation technique for running [[UbuntuHelp:VirtualMachines|VirtualMachines]] under GNU/Linux.
 
See the User-Mode Linux [http://user-mode-linux.sourceforge.net/ project page] for more information.
 
See the User-Mode Linux [http://user-mode-linux.sourceforge.net/ project page] for more information.
----
 
[[category:CategoryNeedsExpansion]] [[category:CategoryCleanup]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年10月19日 (日) 17:54的版本

<<Include(Tag/ContentCleanup)>> <<Include(Tag/NeedsExpansion)>>

Getting Started

This page will help you get started using User-Mode Linux with Ubuntu. Guide is created for Hardy LTS, but will most likely work with other releases: The first thing we need is to install the uml kernel and utilities we will need.

 
sudo apt-get install user-mode-linux uml-utilities bridge-utils 

The next step is getting us a nice ubuntu hardy filesystem:

dd if=/dev/zero of=uml-root-hardy bs=4096 seek=1M count=1
mkfs.xfs uml-root-hardy
sudo mount -o loop uml-root-hardy /mnt
sudo apt-get install debootstrap
sudo debootstrap --arch amd64 hardy /mnt http://us.archive.ubuntu.com/ubuntu
sudo echo "/dev/ubd0     /     xfs     defaults     0 1" > /mnt/etc/fstab
sudo echo "proc  /     proc     proc     defaults     0 0" >> /mnt/etc/fstab
sudo mknod --mode=660 /mnt/dev/ubd0 b 98 0
sudo chown root:disk /mnt/dev/ubd0
sudo echo "127.0.0.1 localhost" /etc/hosts
sudo echo "auto lo \
iface lo inet loopback \
auto eth0 \
iface eth0 inet dhcp" > /mnt/etc/network/interfaces
sudo echo "tty0" >> /mnt/etc/securetty
sudo echo "ttys/0" >> /mnt/etc/securetty

sudo rm /mnt/etc/event.d/tty2
sudo rm /mnt/etc/event.d/tty3
sudo rm /mnt/etc/event.d/tty4
sudo rm /mnt/etc/event.d/tty5
sudo rm /mnt/etc/event.d/tty6
sudo rm /mnt/etc/udev/rules.d/75-persistent-net-generator.rules

Basically what we've done is created an empty filesystem, mounted it, and made some changes that we want done on all our vm's. We should be ready to run our new vm now:

linux ubd0=uml-root-hardy.cow1,uml-root-hardy umid=uml1

User-Mode Linux is another virtualisation technique for running VirtualMachines under GNU/Linux. See the User-Mode Linux project page for more information.