From 52ef12e6a8bc01e783c49de2a9694b27f3eaee81 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Wed, 21 Sep 2016 07:03:44 +0100 Subject: tools qemu revision --- tools/qemu.html | 101 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 50 insertions(+), 51 deletions(-) (limited to 'tools') diff --git a/tools/qemu.html b/tools/qemu.html index e1ea277..ef1c36d 100644 --- a/tools/qemu.html +++ b/tools/qemu.html @@ -2,15 +2,22 @@ - 1. Qemu + Qemu Tools Index -

1. Qemu

+

Qemu

-

Disk images;

+

Kernel configuration

+ +
+        # usermod -a -G kvm c9admin
+        # usermod -a -G kvm username
+        
+ +

Disk images

img
@@ -22,6 +29,46 @@
+ +

Create hard disk image, there is different types, + this describes how to create a qcow2 type;

+ +
+        $ qemu-img create -f qcow2 crux-img.qcow2 20G
+        
+ +

You can mount disk image;

+ +
+        $ sudo modprobe nbd
+        $ sudo qemu-nbd -c /dev/nbd0 /crux-img.qcow2
+        
+ +

To disconnect image disk (ndb); + +

+        $ sudo qemu-nbd -d /dev/nbd0
+        
+ +

You can use image as a normal disk, example how + to use parted to create a gpt system table;

+ +
+        # parted /dev/nbd0
+        (parted) mklabel gpt
+        
+ +

More information about + gpt partition table. +

+ +

If partitions are on qcow2 image then setup partitions;

+ +
+        # kpartx -a -s -l /dev/nbd0
+        
+ +

Network configuration;

slirp
@@ -32,13 +79,6 @@
... ...
-

Kernel configuration

- -
-        # usermod -a -G kvm c9admin
-        # usermod -a -G kvm username
-        
-

Network configuration

Tap interfaces

@@ -97,47 +137,6 @@
 	# tcpdump tap0
 	
- -

Disk image files

- -

Create hard disk image, there is different types, - this describes how to create a qcow2 type;

- -
-        $ qemu-img create -f qcow2 crux-img.qcow2 20G
-        
- -

You can mount disk image;

- -
-        $ sudo modprobe nbd
-        $ sudo qemu-nbd -c /dev/nbd0 /crux-img.qcow2
-        
- -

To disconnect image disk (ndb); - -

-        $ sudo qemu-nbd -d /dev/nbd0
-        
- -

You can use image as a normal disk, example how - to use parted to create a gpt system table;

- -
-        # parted /dev/nbd0
-        (parted) mklabel gpt
-        
- -

More information about - gpt partition table. -

- -

If partitions are on qcow2 image then setup partitions;

- -
-        # kpartx -a -s -l /dev/nbd0
-        
- Tools Index

This is part of the c9 Manual. Copyright (C) 2016 -- cgit 1.4.1-2-gfad0