88- ** Snapshot Capture** : Take screenshots of the video stream
99- ** Keyboard Control** : Send text and keystrokes via HID emulation
1010- ** Mouse Control** : Full mouse support via WebSocket
11- - Absolute positioning (0-65535 coordinate system )
12- - Relative movement
11+ - Absolute positioning (0.0-1.0 normalized coordinates )
12+ - Relative movement (0.0-1.0 normalized, where 1.0 = full screen)
1313 - Left/right/middle button clicks
1414 - Mouse wheel scrolling
15+ - ** Image Management** : Virtual disk and CD-ROM control
16+ - Mount/unmount disk and CD-ROM images
17+ - Download images from URLs
18+ - Check mounted image status
19+ - Monitor download progress
1520- ** Device Management** : Get device info, reboot the NanoKVM
1621- ** Composite Driver** : Access all functionality through a unified interface
1722
@@ -79,7 +84,7 @@ The NanoKVM driver is a composite driver that provides three main interfaces:
7984
8085` ` ` {eval-rst}
8186.. autoclass: : jumpstarter_driver_nanokvm.client.NanoKVMClient()
82- :members : get_info, reboot
87+ :members : get_info, reboot, mount_image, download_image, get_mounted_image, get_cdrom_status, is_image_download_enabled, get_image_download_status
8388` ` `
8489
8590### NanoKVMVideoClient
@@ -151,11 +156,14 @@ j nanokvm hid reset
151156# ### Mouse Commands
152157
153158` ` ` bash
154- # Move mouse to absolute coordinates (0-65535, scaled to screen)
155- j nanokvm hid mouse move 32768 32768 # Center of screen
159+ # Move mouse to absolute coordinates (0.0-1.0, where 0.0=top/left, 1.0=bottom/right)
160+ j nanokvm hid mouse move 0.5 0.5 # Center of screen
161+ j nanokvm hid mouse move 0.0 0.0 # Top-left corner
162+ j nanokvm hid mouse move 1.0 1.0 # Bottom-right corner
156163
157- # Move mouse relatively (-127 to 127)
158- j nanokvm hid mouse move-rel 50 50 # Move right and down
164+ # Move mouse relatively (-1.0 to 1.0, where 1.0 = full screen width/height)
165+ j nanokvm hid mouse move-rel 0.1 0.1 # Move right and down by 10% of screen
166+ j nanokvm hid mouse move-rel -0.2 0.0 # Move left by 20% of screen width
159167
160168# Click at current position (default: left button)
161169j nanokvm hid mouse click
@@ -164,7 +172,7 @@ j nanokvm hid mouse click
164172j nanokvm hid mouse click --button right
165173
166174# Click at specific coordinates
167- j nanokvm hid mouse click --x 32768 --y 32768 --button left
175+ j nanokvm hid mouse click --x 0.5 --y 0.5 --button left
168176
169177# Scroll (default: down 5 units)
170178j nanokvm hid mouse scroll
@@ -176,6 +184,34 @@ j nanokvm hid mouse scroll --dy 5
176184j nanokvm hid mouse scroll --dy -5
177185` ` `
178186
187+ # ## Image Management Commands
188+
189+ ` ` ` bash
190+ # Mount a disk image
191+ j nanokvm image mount /data/myimage.img
192+
193+ # Mount a CD-ROM image
194+ j nanokvm image mount /data/installer.iso --cdrom
195+
196+ # Unmount current image
197+ j nanokvm image unmount
198+
199+ # Check mounted image status
200+ j nanokvm image status
201+
202+ # Check if mounted image is in CD-ROM mode
203+ j nanokvm image cdrom-status
204+
205+ # Download an image from URL
206+ j nanokvm image download https://example.com/image.iso
207+
208+ # Check if image downloads are enabled
209+ j nanokvm image download-enabled
210+
211+ # Check download progress
212+ j nanokvm image download-status
213+ ` ` `
214+
179215# ## Example Session
180216
181217` ` ` bash
@@ -185,6 +221,14 @@ jmp shell -l my=device
185221# Inside the shell, use the commands
186222j nanokvm info
187223j nanokvm video snapshot my_screen.jpg
224+
225+ # Mount a CD-ROM image
226+ j nanokvm image mount /data/installer.iso --cdrom
227+ j nanokvm image status
228+
229+ # Control the mouse and keyboard
230+ j nanokvm hid mouse move 0.5 0.5
231+ j nanokvm hid mouse click
188232j nanokvm hid paste "echo 'Hello from NanoKVM'\n "
189233` ` `
190234
@@ -216,17 +260,24 @@ nanokvm.hid.press_key("\t") # Tab
216260# ## Mouse Control
217261
218262` ` ` python
219- # Move mouse to center of screen
220- nanokvm.hid.mouse_move_abs(32768, 32768)
263+ # Move mouse to center of screen (normalized 0.0-1.0 coordinates)
264+ nanokvm.hid.mouse_move_abs(0.5, 0.5)
265+
266+ # Move to top-left corner
267+ nanokvm.hid.mouse_move_abs(0.0, 0.0)
268+
269+ # Move to bottom-right corner
270+ nanokvm.hid.mouse_move_abs(1.0, 1.0)
221271
222272# Click left button
223273nanokvm.hid.mouse_click("left")
224274
225275# Click at specific coordinates
226- nanokvm.hid.mouse_click("left", x=32768 , y=16384 )
276+ nanokvm.hid.mouse_click("left", x=0.5 , y=0.25 )
227277
228- # Move mouse relatively
229- nanokvm.hid.mouse_move_rel(50, 50) # Move right and down
278+ # Move mouse relatively (normalized -1.0 to 1.0, where 1.0 = full screen)
279+ nanokvm.hid.mouse_move_rel(0.1, 0.1) # Move right/down by 10% of screen
280+ nanokvm.hid.mouse_move_rel(-0.2, 0.0) # Move left by 20% of screen width
230281
231282# Scroll up
232283nanokvm.hid.mouse_scroll(0, 5)
@@ -235,6 +286,38 @@ nanokvm.hid.mouse_scroll(0, 5)
235286nanokvm.hid.mouse_scroll(0, -5)
236287` ` `
237288
289+ # ## Image Management
290+
291+ ` ` ` python
292+ # Mount a disk image
293+ nanokvm.mount_image("/data/myimage.img", cdrom=False)
294+
295+ # Mount a CD-ROM image
296+ nanokvm.mount_image("/data/installer.iso", cdrom=True)
297+
298+ # Unmount current image
299+ nanokvm.mount_image("")
300+
301+ # Get mounted image info
302+ file = nanokvm.get_mounted_image()
303+ if file:
304+ print(f"Mounted: {file}")
305+ is_cdrom = nanokvm.get_cdrom_status()
306+ print(f"Mode: {'CD-ROM' if is_cdrom else 'Disk'}")
307+
308+ # Download an image
309+ status = nanokvm.download_image("https://example.com/image.iso")
310+ print(f"Download: {status['status']}, File: {status['file']}")
311+
312+ # Check if downloads are enabled
313+ if nanokvm.is_image_download_enabled():
314+ print("Downloads are available")
315+
316+ # Monitor download progress
317+ status = nanokvm.get_image_download_status()
318+ print(f"Status: {status['status']}, Progress: {status['percentage']}")
319+ ` ` `
320+
238321# ## Device Management
239322
240323` ` ` python
0 commit comments