本文主要是介绍kvm学习 - 迅速上手示例,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
kvmtool
kvmsample
kvmtool
GitHub - kvmtool/kvmtool: Stand-alone Native Linux KVM Tool repoStand-alone Native Linux KVM Tool repo. Contribute to kvmtool/kvmtool development by creating an account on GitHub.https://github.com/kvmtool/kvmtool.git
cd linux-4.19.314
vim .config
make menuconfig
make bzImage
cd kvmtool
make
./kvmtool/lkvm run --disk busybox-1.32.0/rootfs.img --kernel linux-4.19.314/arch/x86/boot/bzImage --network virtio
[ 1.258999] mpls_gso: MPLS GSO support
[ 1.266097] mce: Using 32 MCE banks
[ 1.266976] sched_clock: Marking stable (1260247822, 6666344)->(1292583338, -25669172)
[ 1.272405] registered taskstats version 1
[ 1.273291] Loading compiled-in X.509 certificates
[ 1.306523] Loaded X.509 cert 'Build time autogenerated kernel key: 757998206b609d18c4420f1a70819e82e555d1bb'
[ 1.308873] zswap: loaded using pool lzo/zbud
[ 1.312077] page_owner is disabled
[ 1.316333] Key type big_key registered
[ 1.318660] Key type trusted registered
[ 1.320881] Key type encrypted registered
[ 1.321887] ima: No TPM chip found, activating TPM-bypass!
[ 1.323132] ima: Allocated hash algorithm: sha1
[ 1.324114] evm: Initialising EVM extended attributes:
[ 1.325212] evm: security.selinux
[ 1.325935] evm: security.ima
[ 1.326580] evm: security.capability
[ 1.327331] evm: HMAC attrs: 0x1
[ 1.328089] Magic number: 12:316:478
[ 1.328973] hctosys: unable to open rtc device (rtc0)
[ 1.330418] md: Waiting for all devices to be available before autodetect
[ 1.331859] md: If you don't use raid, use raid=noautodetect
[ 1.333631] md: Autodetecting RAID arrays.
[ 1.334517] md: autorun ...
[ 1.335113] md: ... autorun DONE.
[ 1.336436] EXT4-fs (vda): mounting ext2 file system using the ext4 subsystem
[ 1.338733] EXT4-fs (vda): warning: mounting unchecked fs, running e2fsck is recommended
[ 1.341284] EXT4-fs (vda): mounted filesystem without journal. Opts: (null)
[ 1.342797] VFS: Mounted root (ext2 filesystem) on device 253:0.
[ 1.344681] devtmpfs: mounted
[ 1.588912] Freeing unused decrypted memory: 2040K
[ 1.651098] Freeing unused kernel image memory: 2524K
[ 1.655588] Write protecting the kernel read-only data: 18432k
[ 1.660867] Freeing unused kernel image memory: 2012K
[ 1.662805] Freeing unused kernel image memory: 328K
[ 1.664321] rodata_test: all tests were successful
[ 1.665348] Run /sbin/init as init process
mount: mounting none on /dev/pts failed: No such file or directory
mount: mounting Tmpfs on /dev/shm failed: No such file or directory
id: unknown ID 0
/ #
kvmsample
GitHub - soulxu/kvmsample: minivm based on kvmminivm based on kvm. Contribute to soulxu/kvmsample development by creating an account on GitHub.https://github.com/soulxu/kvmsample.git
cd kvmsample
make
[root@Host-HF2GD3X kvmsample]# ./kvmsample
read size: 712288
KVM start run
KVM_EXIT_IO
out port: 16, data: 0
KVM start run
KVM_EXIT_IO
out port: 16, data: 1
KVM start run
KVM_EXIT_IO
out port: 16, data: 2
KVM start run
KVM_EXIT_IO
out port: 16, data: 3
KVM start run
KVM_EXIT_IO
out port: 16, data: 4
KVM start run
KVM_EXIT_IO
out port: 16, data: 5
KVM start run
KVM_EXIT_IO
out port: 16, data: 6
KVM start run
KVM_EXIT_IO
out port: 16, data: 7
^C
这篇关于kvm学习 - 迅速上手示例的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!