{"id":228,"date":"2022-12-04T12:20:20","date_gmt":"2022-12-04T17:20:20","guid":{"rendered":"https:\/\/daveking.com\/blog\/?p=228"},"modified":"2022-12-04T12:20:46","modified_gmt":"2022-12-04T17:20:46","slug":"using-a-physical-storage-device-in-a-kvm","status":"publish","type":"post","link":"https:\/\/daveking.com\/blog\/index.php\/2022\/12\/04\/using-a-physical-storage-device-in-a-kvm\/","title":{"rendered":"Using A Physical Storage Device In A KVM"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It is possible to attach a physical storage device directly to a kernel virtual machine but it cannot be done through the virt-manager GUI tool, it has to be handed-coded.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Shut down the KVM.<\/li>\n\n\n\n<li>Edit the domain configuration XML.  This can be done in the virt-manager UI or by directly editing the domain XML file.  KVM XML files are located in <code>\/etc\/libvirt\/qemu<\/code> on Fedora-based systems.<\/li>\n\n\n\n<li>Add the following stanza in the <code>&lt;devices><\/code> section.  Adjust the source and target dev attributes appropriately.\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;disk type=\"block\" device=\"disk\">\n  &lt;driver name=\"qemu\" type=\"raw\"\/>\n  &lt;source dev=\"\/dev\/sdX\"\/>\n  &lt;target dev=\"vdX\" bus=\"virtio\"\/>\n&lt;\/disk><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It is possible to attach a physical storage device directly to a Linux kernel virtual machine (KVM) but it cannot be done through the virtual-manager GUI tool, it has to be hand-coded.<\/p>\n","protected":false},"author":1,"featured_media":229,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[22,7],"tags":[23,3],"class_list":["post-228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howto","category-linux-administration","tag-howto","tag-linux","eq-blocks"],"jetpack_publicize_connections":[],"jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/daveking.com\/blog\/wp-content\/uploads\/2022\/12\/kvm-logo-e1670174144392.png?fit=301%2C206&ssl=1","_links":{"self":[{"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":1,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/228\/revisions\/230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/229"}],"wp:attachment":[{"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daveking.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}