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(-) 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 e='Blame the previous revision' href='/akspecs/ranger/blame/doc/ranger.gui.ui.html?h=v1.9.0b1&id=4e01caf19cfbc798862e6b8b2dbd77328c8f99a2'>^

b3556b21 ^












f07bb12f ^






4c13e1f2 ^


f07bb12f ^



























4c13e1f2 ^
f07bb12f ^












































4c13e1f2 ^
f07bb12f ^


f07bb12f ^



4c13e1f2 ^
f07bb12f ^







4c13e1f2 ^
f07bb12f ^
4c13e1f2 ^

f07bb12f ^



f07bb12f ^















4c13e1f2 ^











f07bb12f ^
b3556b21 ^
f07bb12f ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166