The application discloses a method and
system for transmitting local file data to a
virtual machine block device, and belongs to the technical field of computer virtual devices. The application uses
websocket transmission technology and NBD (
Network Block Device) technology, and through designing a management and forwarding device, i.e. a block device mounting management device, mounting requests of clients are uniformly managed, and the block device mounting management device can serve as an intermediary to establish a connection between the clients and a
virtualization hypervisor layer, so that mutual communication is achieved. Then, the NBD protocol is used to
mount the block device as a network device. The application can directly
mount read-only block device files (such as optical drive files, block disk files and the like) to a
virtual machine through a
web browser, and realizes corresponding systems. Therefore, the purpose of directly remotely mounting and unmounting and transmitting data
on demand without uploading block device files and without additionally downloading a
client auxiliary can be achieved.