Debian系统中如何安装KVM虚拟机
作者:贺bujak_491 | 来源:互联网 | 2014-05-27 21:08
今天实验了一下kvm的远程安装。同时开了3个kvm给朋友实验。同时安装系统。cpu的占用没有超过3%.同时这个服务器还运行着web服务。kvm可性能还是不错的。远在网通机房的一台服务器,amd浩龙的双核amdcpu,支持硬件虚拟技术,在上面实施kvm虚拟机记录如下:de
今天实验了一下kvm的远程安装。
同时开了3个kvm给朋友实验。
同时安装系统。
cpu的占用没有超过3%. 同时这个服务器还运行着web服务。kvm可性能还是不错的。
远在网通机房的一台服务器,amd浩龙的双核amd cpu,支持硬件虚拟技术,在上面实施kvm虚拟机记录如下:
debian的etch版本下是没有kvm虚拟机的,所以先把内核模块源码和kvm从sid版本拿过来。
首先修改 /etc/apt/sources.list 将sid源加进去。然后aptitude update
只要安装几个包就行了:
aptitude install kvm kvm-source
装完后马上修改sources.list.降回到etch版。
现在开始给etch的2.6.18生成kvm内核模块
执行modules-assistant 在图形界面下,选中kvm模块,然后build并安装内核模块。就这么简单,kvm就安装好了。
下面就是系统的安装了。
kvm使用的是qemu虚拟机程序。qemu有2种方式支持远程运行。
1.字符模式,就是把串口关联在当前的控制台,这样在安装的时候,安装程序的内核参数增加一个cOnsole=ttyS0
就可以让安装程序的控制台使用串口,也就是kvm运行的终端。
2.vnc模式 就是远程机器连接到本机的某个vnc端口,作为kvm的显示器,vnc模式灵活性比较大,我们采用这种模式。
先生成一个5G虚拟磁盘。
qemu-img create /home/kvm.img
5000000
从debian.org下载
安装盘 netinst.iso
启动安装过程
kvm -vnc
210.51.xx.xx:0 -hda kvm.img
-cdrom netinst.iso -boot d
然后,通过vncview或者rdesktop连接远程的210.51.xx.xx:0,
进行正常的安装过程。
安装结束从新启动kvm,去掉光驱
不启动图形界面 后台运行。
kvm -nographic -daemonize -hda kvm.img
然后就可以用ssh对它进行远程登录管理了。
只要备份和复制kvm.img就可以把这个虚拟计算机移动到其他的物理服务器上
cpuinfo和dmesg信息如下:
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model :
2
model name : QEMU Virtual CPU version
0.9.0
stepping : 3
cpu MHz :
2000.261
cache size : 512 KB
fpu
: yes
fpu_exception : yes
cpuid level : 2
wp
: yes
flags :
fpu de pse tsc msr pae mce cx8 sep pge mca cmov pat pse36 clflush
mmx fxsr sse sse2 syscall nx lm up pni
bogomips : 4167.30
TLB size : 1024 4K
pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
hdparm -tT /dev/hda
/dev/hda:
Timing cached reads: 1886 MB in 2.00
secOnds= 945.10 MB/sec
Timing buffered disk reads: 100 MB in 3.04
secOnds= 32.94 MB/sec
hdparm -i /dev/hda
/dev/hda:
Model=QEMU HARDDISK, FwRev=0.9.0, SerialNo=QM00001
COnfig={ Fixed }
RawCHS=5952/16/63, TrkSize=32256, SectSize=512,
ECCbytes=4
BuffType=DualPortCache, BuffSize=256kB, MaxMultSect=16,
MultSect=off
CurCHS=5952/16/63, CurSects=5999616, LBA=yes,
LBAsects=6000000
IORDY=yes, tPIO={min:120,w/IORDY:120},
tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2
DMA modes: mdma0 mdma1 *mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 udma3 udma4
udma5
AdvancedPM=no
Drive conforms to: ATA/ATAPI-5 published, ANSI INCITS
340-2000: ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7
* signifies the current active mode
dmesg:
Bootdata ok (command line is root=/dev/hda1 ro )
Linux version 2.6.18-4-amd64 (Debian 2.6.18.dfsg.1-11)
(waldi@debian.org)
(gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP
Wed Feb 21 14:29:38 UTC 2007
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 0000000007ff0000 (usable)
BIOS-e820: 0000000007ff0000 - 0000000008000000 (ACPI
data)
BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
DMI not present or invalid.
ACPI: RSDP (v000
BOCHS
) @ 0x00000000000fa6a0
ACPI: RSDT (v000 BOCHS BXPCRSDT 0x00000001 BXPC 0x00000001) @
0x0000000007ff0000
ACPI: FADT (v000 BOCHS BXPCFACP 0x00000001 BXPC 0x00000001) @
0x0000000007ff002c
ACPI: MADT (v000 BOCHS BXPCAPIC 0x00000001 BXPC 0x00000001) @
0x0000000007ff0938
ACPI: DSDT (v001 BXPC BXDSDT 0x00000001
INTL 0x20060912) @ 0x0000000000000000
No NUMA configuration found
Faking a node at 0000000000000000-0000000007ff0000
Bootmem setup node 0 0000000000000000-0000000007ff0000
On node 0 totalpages: 31322
DMA zone: 3057 pages, LIFO batch:0
DMA32 zone: 28265 pages, LIFO batch:7
ACPI: PM-Timer IO Port: 0xb008
Intel MultiProcessor Specification v1.4
Virtual Wire compatibility mode.
OEM ID: BOCHSCPU Product ID:
0.1 APIC at:
0xFEE00000
Processor #0 6:0 APIC version 17
I/O APIC #1 Version 17 at 0xFEC00000.
Setting APIC routing to physical flat
Processors: 1
Allocating PCI resources starting at 10000000 (gap:
8000000:f7fc0000)
SMP: Allowing 1 CPUs, 0 hotplug CPUs
Built 1 zonelists. Total pages: 31322
Kernel command line: root=/dev/hda1 ro
Initializing CPU#0
PID hash table entries: 512 (order: 9, 4096 bytes)
time.c: Using 3.579545 MHz WALL PM GTOD PIT/TSC timer.
time.c: Detected 2000.180 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
Checking aperture...
Memory: 120128k/131008k available (1930k kernel code, 10492k
reserved, 868k data, 176k init)
Calibrating delay using timer specific routine.. 4012.01 BogoMIPS
(lpj=8024036)
Security Framework v1.0.0 initialized
SELinux: Disabled at boot.
Capability LSM initialized
Mount-cache hash table entries: 256
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64
bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU 0/0 -> Node 0
SMP alternatives: switching to UP code
Freeing SMP alternatives: 28k freed
ACPI: Core revision 20060707
ACPI: setting ELCR to 0800 (from 0a00)
ACPI Error (hwacpi-0179): Hardware did not change modes
[20060707]
ACPI Error (evxfevnt-0084): Could not transition to ACPI mode
[20060707]
ACPI Warning (utxface-0154): AcpiEnable failed [20060707]
ACPI: Unable to enable ACPI
BIOS bug, local APIC #0 not detected!...
... forcing use of dummy APIC emulation. (tell your hw vendor)
SMP disabled
Brought up 1 CPUs
testing NMI watchdog ... CPU#0: NMI appears to be stuck
(0->0)!
migration_cost=0
checking if image is initramfs... it is
Freeing initrd memory: 4893k freed
NET: Registered protocol family 16
PCI: Using configuration type 1
ACPI: Interpreter disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI: disabled
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI quirk: region b000-b03f claimed by PIIX4 ACPI
PCI quirk: region b100-b10f claimed by PIIX4 SMB
Boot video device is 0000:00:02.0
PCI: Using IRQ router PIIX/ICH [8086/7000] at 0000:00:01.0
PCI-GART: No AMD northbridge found.
pnp: the driver 'system' has been registered
PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 1, 8192 bytes)
TCP established hash table entries: 4096 (order: 4, 65536
bytes)
TCP bind hash table entries: 2048 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 2048)
TCP reno registered
audit: initializing netlink socket (disabled)
audit(1173865286.592:1): initialized
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
PCI: PIIX3: Enabling Passive Release on 0000:00:01.0
Limiting direct PCI/PCI transfers.
Activating ISA DMA hang workarounds.
Real Time Clock Driver v1.12ac
Linux agpgart interface v0.101 (c) Dave Jones
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing
enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450
pnp: the driver 'serial' has been registered
RAMDISK driver initialized: 16 RAM disks of 65536K size 1024
blocksize
pnp: the driver 'i8042 kbd' has been registered
pnp: the driver 'i8042 aux' has been registered
pnp: the driver 'i8042 kbd' has been unregistered
pnp: the driver 'i8042 aux' has been unregistered
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
NET: Registered protocol family 20
Freeing unused kernel memory: 176k freed
input: AT Translated Set 2 keyboard as /class/input/input0
Losing some ticks... checking if CPU frequency changed.
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
PIIX3: IDE controller at PCI slot 0000:00:01.1
PIIX3: chipset revision 0
PIIX3: not 100% native mode: will probe irqs later
PCI: Setting latency timer of device 0000:00:01.1 to 64
ide0: BM-DMA at 0xc000-0xc007, BIOS settings:
hda:pio, hdb:pio
ide1: BM-DMA at 0xc008-0xc00f, BIOS settings:
hdc:pio, hdd:pio
Probing IDE interface ide0...
ne2k-pci.c:v1.03 9/22/2003 D. Becker/P. Gortmaker
http://www.scyld.com/network/ne2k-pci.html
hda: QEMU HARDDISK, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: QEMU CD-ROM, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
PCI: setting IRQ 11 as level-triggered
PCI: Found IRQ 11 for device 0000:00:03.0
eth0: RealTek RTL-8029 found at 0xc100, IRQ 11,
52:54:00:12:34:56.
hda: max request size: 512KiB
hda: 6000000 sectors (3072 MB) w/256KiB Cache, CHS=5952/255/63,
(U)DMA
hda: set_multmode: status=0x41 { DriveReady Error }
hda: set_multmode: error=0x04 { DriveStatusError }
ide: failed opcode was: 0xef
hda: cache flushes supported
hda: hda1 hda2
hdc: ATAPI 4X CD-ROM drive, 512kB Cache, (U)DMA
Uniform CD-ROM driver Revision: 3.20
Attempting manual resume
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
input: PC Speaker as /class/input/input1
piix4_smbus 0000:00:01.3: Found 0000:00:01.3 device
input: ImExPS/2 Generic Explorer Mouse as /class/input/input2
ts: Compaq touchscreen protocol output
Adding 184708k swap on /dev/hda5. Priority:-1 extents:1
across:184708k
EXT3 FS on hda1, internal journal
loop: loaded (max 8 devices)
device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised:
dm-devel@redhat.com
推荐阅读
-
介绍一款备受好评的全能型终端工具——MobaXterm,它不仅功能强大,而且完全免费,适合各类用户使用。 ...
[详细]
蜡笔小新 2024-12-16 21:02:15
-
本文详细介绍了Linux操作系统中的cp和scp命令,包括它们的基本使用方法、常见选项以及如何通过scp命令安全地在不同主机之间传输文件。 ...
[详细]
蜡笔小新 2024-12-16 15:11:30
-
-
转自:http:www.yybug.comread-htm-tid-15324.html为什么使用Twisted? 如果你并不准备使用Twisted,你可能有很多异议。为什么使用T ...
[详细]
蜡笔小新 2024-12-13 14:57:51
-
本文介绍了如何在Ubuntu 16.04系统上配置Nginx服务器,以便能够通过网络访问存储在服务器上的图片资源。这解决了在网页开发中需要使用自定义在线图标的需求。 ...
[详细]
蜡笔小新 2024-12-12 16:35:25
-
本文介绍了如何在Linode服务器上以root用户身份安装Xubuntu,并解决尝试启动图形界面时遇到的'无屏幕找到'错误。 ...
[详细]
蜡笔小新 2024-12-12 13:35:42
-
本文详细介绍如何在Linux操作系统中配置Subclipse,以便通过SSH协议安全访问SVN仓库。不同于常见的Windows配置指南,本文提供了针对Linux用户的详细步骤。 ...
[详细]
蜡笔小新 2024-12-07 20:20:13
-
本文详细介绍了如何在Linux系统上搭建Web服务器的过程,包括安装Apache、PHP和MySQL等关键组件,以及遇到的一些常见问题及其解决方案。 ...
[详细]
蜡笔小新 2024-12-17 19:02:43
-
本文档详细介绍了如何在Ubuntu 14.04 (Desktop AMD64) 系统上安装和配置ROS Indigo。包括设置软件源、安装ROS核心组件、初始化rosdep以及创建ROS工作空间等步骤。 ...
[详细]
蜡笔小新 2024-12-06 12:55:49
-
本文详细介绍了如何在 Windows 系统中安装 Git 工具,并通过配置 SSH 密钥实现与 GitHub 的安全连接。包括下载、安装、环境配置及验证连接等关键步骤。 ...
[详细]
蜡笔小新 2024-12-17 16:22:46
-
本文探讨了Unix和Linux操作系统的起源和发展历程。从20世纪60年代计算机技术的初期阶段,到Unix的诞生及后续Linux的崛起,文章详细介绍了这些操作系统如何逐步成为现代计算不可或缺的一部分。 ...
[详细]
蜡笔小新 2024-12-07 12:39:27
-
对于喜爱使用 Linux 终端进行日常操作的系统管理员来说,Calcurse 提供了一种强大的方式来管理日程安排、待办事项及会议。本文将详细介绍如何在 Linux 上安装和使用 Calcurse,帮助用户更有效地组织工作。 ...
[详细]
蜡笔小新 2024-11-21 17:01:54
-
本文介绍了Linux操作系统的核心组成部分——内核及其版本分类,以及市面上常见的几种Linux发行版,旨在为初学者提供一个清晰的学习路径。 ...
[详细]
蜡笔小新 2024-11-20 10:09:16
-
本文详细介绍如何在华为鲲鹏平台上构建和使用适配ARM架构的Redis Docker镜像,解决常见错误并提供优化建议。 ...
[详细]
蜡笔小新 2024-11-19 15:04:08
-
本文详细介绍了如何使用Layui框架实现动态和静态数据表的分页功能,具有较高的实用性和参考价值。适合需要开发管理后台的开发人员参考。 ...
[详细]
蜡笔小新 2024-11-17 10:11:33
-
在 Ubuntu 中遇到 Samba 服务器故障时,尝试卸载并重新安装 Samba 发现配置文件未重新生成。本文介绍了解决该问题的方法。 ...
[详细]
蜡笔小新 2024-11-12 13:02:23
-
贺bujak_491
这个家伙很懒,什么也没留下!