linux初探

首页

应用服务器

Linux技巧

中文文档

Linux初级

服务器源代码

命令详解

Linux技术应用

Linux安全应用

Linux业界新闻

UniX技术文章

Linux编程与内核

Linux数据库

Linux服务器

Linux安装指导

Linux论坛


首页>>Linux安全应用>>

热门文章

·利用135端口漏洞入侵个人电脑
·网吧频繁掉线(ARP)与解决方
·新手学堂:防火墙在网络中的
·害怕受网络攻击 英国公民干脆
·知己知彼:IEXPLORE命令行参
·保护个人隐私 隐藏在图片背后
·顶尖网络高手写的alexa作弊完
·国庆期间有45万余台计算机感
·病毒门诊:清除猖狂的Sxs.ex
·电脑用户须知 忘记分级审查密

推荐文章

在SuSE10.0下安装qemu


1. 编译qemu
用SuSE10.0自带的gcc-4.0.2编译qemu会出现下面的问题
# cd /usr/local/qemu-0.9.0
# ./configure
WARNING: "gcc" looks like gcc 4.x
Looking for gcc 3.x
gcc 3.x not found!
QEMU is known to have problems when compiled with gcc 4.x
It is recommended that you use gcc 3.x to build QEMU
To use this compiler anyway, configure with --disable-gcc-check
因此可以先装一个gcc-3.4.6
# which gcc
/usr/local/bin
# gcc --version
gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# cd /usr/local/qemu-0.9.0
# ./configure; make; make install

2. 编译kqemu
如果你还用gcc-3.4.6编译kqemu,在插入模块时会出现下面的问题
# modprobe kqemu
FATAL: Error inserting kqemu (/lib/modules/2.6.13-15-smp/misc/kqemu.ko): Invalid module format
因此在编译kqemu时要用系统自带的gcc-4.0.2
# which gcc
/usr/bin/gcc
# gcc --version
gcc (GCC) 4.0.2 20050901 (prerelease) (SUSE Linux)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# cd /usr/local/qemu-0.9.0/kqemu-1.3.0pre11
# ./configure; make; make install
# modprobe kqemu
# lsmod | grep  kqemu
kqemu                 128548  0
# modinfo kqemu
filename:       /lib/modules/2.6.13-15-smp/misc/kqemu.ko
license:        GPL
vermagic:       2.6.13-15-smp SMP 586 REGPARM gcc-4.0
depends:
parm:           major:int

3. 网络设置
# qemu -cdrom slax-5.1.8.1.iso
用slax启动盘启动后,slax会得到一个10.0.2.15的ip,你的SuSE10.0会默认为10.0.2.2,域名服务器的ip是10.0.2.3。你可以通过ssh连接到SuSE10.0上
# ssh 10.0.2.2
如果虚拟的是windows,在地址栏中键入
//10.0.2.2
就可以通过samba和SuSE10.0交换文件了

4. 磁盘操作
# qemu-img create win.img 10G
# qemu -hda win.img -cdrom TomatoWinXP_SP2_v3_0.iso -boot d -m 384
下面介绍通过回环设备将image文件挂载到本地,和本地文件系统直接交互。

# losetup /dev/loop0 win.img
# fdisk /dev/loop0

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): x

Expert command (m for help): p

Disk /dev/loop0: 255 heads, 63 sectors, 2610 cylinders

Nr AF  Hd Sec  Cyl  Hd Sec  Cyl     Start      Size ID
 1 80   1   1    0 254  63  568         63    9140922 0b
 2 00   0   0    0   0   0    0          0          0 00
 3 00   0   0    0   0   0    0          0          0 00
 4 00   0   0    0   0   0    0          0          0 00

Expert command (m for help): q

# losetup -o 32256 /dev/loop1 win.img
# mount -t vfat /dev/loop1 win
# cd win
# ls
Documents and Settings  autoexec.bat  config.sys    io.sys        ntldr
Program Files           boot.ini      found.000     msdos.sys     pagefile.sys
Recycled                bootfont.bin  hiberfil.sys  ntdetect.com  windows

32256是用start*512算出来的,在本例中start=63
拷贝完文件后最后别忘了进行清理
# losetup -a
/dev/loop0: [0302]:241 (win.img)
/dev/loop1: [0302]:241 (win.img) offset=32256
# umount win
# losetup -d /dev/loop0
# losetup -d /dev/loop1

上面的操作在赵炯老师的《Linux内核完全注释》电子版中有更详细的讲解
摘自:http://blog.chinaunix.net/u/23177/showart_248414.html
Linux联盟收集整理

相关文章:

·在虚拟机下体验ubuntu
·将eva启动项添加到gnome环境的菜单中
·Ubuntu分辨率的设置
·grub的用法
·linux怎么给一个普通用户reboot权限
·linux启动服务功能介绍
·Linux 的带宽管理系统
·Debian命令总结
·Linux下配置Gnome的文件打开方式&开始菜单管理
·RoseHA(for Solaris)快速安装指引

Copyright@2005 www.linuxGoo.com All Right Reserved