> For the complete documentation index, see [llms.txt](https://huataihuang.gitbook.io/cloud-atlas-draft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huataihuang.gitbook.io/cloud-atlas-draft/virtual/xen/storage/mount_iso_image_on_xen_guest.md).

# 在Xen中挂载iso镜像文件

要将本地的iso文件挂载到xen虚拟机中，可以尝试如下命令：

```bash
sudo xm block-attach INSTANCE_NAME file://home/images/xen_drivers.iso /dev/sdb r
```

如果是xen server平台，可以将iso镜像问文件复制到本地目录下，然后创建一个本地的ISO库

```bash
xe sr-create name-label=ISO1 type=iso \
device-config:location=/var/opt/xen/iso_import/ISO1 \
device-config:legacy_mode=true content-type=iso
```

之后就可以使用命令`xe vdi-list`查看到挂载的本地ISO镜像库。

[How to add local ISO storage repo in XenServer](http://www.dedoimedo.com/computers/xen-xenserver-local-iso-repo.html)提供了3中本地挂载的方法，也可借鉴。

> 在KVM环境下，可以使用`virsh attach-disk`命令来挂载iso镜像文件

## 参考

* [How to mount a CDROM on a Xen guest virtual machine?](http://serverfault.com/questions/44895/how-to-mount-a-cdrom-on-a-xen-guest-virtual-machine)
* [Attach ISO image stored in XenServer local storage](http://www.linuxscrew.com/2012/04/06/local-iso-image-xenserver/)
* [How to add local ISO storage repo in XenServer](http://www.dedoimedo.com/computers/xen-xenserver-local-iso-repo.html)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/virtual/xen/storage/mount_iso_image_on_xen_guest.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
