Skip to contentSkip to conversation

Host <-> guest interface port?

Qemu-devel Matthew Mastracci 4 participants 8 messages May 4, 2004 – May 6, 2004

lore
Share & tools
lore
#0 lore raw

Would it be possible to add a host/guest interface port, akin to how VMWare handles this? It's a convenient way to get/set various properties from the host while running the guest operating system. This also allows a smoother mouse interface - ie: auto capture/release of the mouse as it hits the screen boundaries, clipboard synchronization as well as synchronization of the guest's clock with the host's.

Some more info on the VMWare port is here:
http://chitchat.at.infoseek.co.jp/vmware/backdoor.html

Matt.

begin:vcard
fn:Matthew Mastracci
n:Mastracci;Matthew
org:aclaro Softworks, inc.
adr:;;1900 a - 11 St. SE;Calgary;Alberta;T2H 3G2;Canada email;internet:[email protected]
title:Software Developer
tel;work:(403) 299-6612
x-mozilla-html:FALSE
url:http://www.aclaro.com
version:2.1
end:vcard

#1 lore raw
Quoted 4 lines · Matthew Mastracci

Would it be possible to add a host/guest interface port, akin to how VMWare handles this? It's a convenient way to get/set various properties from the host while running the guest operating system. This also allows a smoother mouse interface - ie: auto capture/release of the mouse as it hits the screen boundaries, clipboard synchronization as well as synchronization of the guest's clock with the host's.

Some more info on the VMWare port is here:
http://chitchat.at.infoseek.co.jp/vmware/backdoor.html

Of course it is possible to add that, but first we must define the features we want and implement the necessary support in the guest OSes, which seems to be the most difficult AFAIK. Clipboard support would be interesting. Does anyone know how to implement it for Linux and Windows guests ?

Fabrice.

#2 lore raw
Quoted 5 lines · Fabrice Bellard

Of course it is possible to add that, but first we must define the features we want and implement the necessary support in the guest OSes, which seems to be the most difficult AFAIK. Clipboard support would be interesting. Does anyone know how to implement it for Linux and Windows guests ?

A clipboard solution that requires no current changes to qemu or custom drivers in windows (and that is currently used by many win4lin users) is the MultiPlatform ClipBoard program, or mpcb. It is available at
http://www.idata.sk/~robo/mpcb/ and can link clipboards on a variety of platforms over a socket (tcp/ip) connection.

Michael

Quoted 9 lines

Fabrice.

_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel

Signature · 1 line
Michael L Torrie <[email protected]>
#3 lore raw
In reply to Fabrice Bellard
Quoted 10 lines · Fabrice Bellard
Quoted 4 lines · Matthew Mastracci

Would it be possible to add a host/guest interface port, akin to how VMWare handles this? It's a convenient way to get/set various properties from the host while running the guest operating system. This also allows a smoother mouse interface - ie: auto capture/release of the mouse as it hits the screen boundaries, clipboard synchronization as well as synchronization of the guest's clock with the host's.

Some more info on the VMWare port is here:
http://chitchat.at.infoseek.co.jp/vmware/backdoor.html

Of course it is possible to add that, but first we must define the features we want and implement the necessary support in the guest OSes, which seems to be the most difficult AFAIK. Clipboard support would be interesting. Does anyone know how to implement it for Linux and Windows guests ?

I can implement text-clipboard-passing for a windows guest without much effort. If the CPU protection for the IO port is disabled, even when running at IOPL3, it could be implemented entirely in userspace.

It would be nice to define standard register values for the different features, as well as add functionality to query the availability of the feature. For instance, the first two registers could define the supported interface:

Register 0: Returns the maximum supported register index by the current version of QEMU
Register 1: Write to the register with a given register index - returns 1 if supported or 0 if unsupported or disabled.

Possible register functionality (off the top of my head):
- Get host clock: returns the host clock time in UTC (useful for clock sync between guest/host)
- Get host clock TZ: returns the host clock offset relative to UTC
- Set host's clipboard
- Get host's clipboard
- Attach/detach virtual device (floppy/cd/etc)
- Transfer file (?)
- Read guest filesystem

Matt.

begin:vcard
fn:Matthew Mastracci
n:Mastracci;Matthew
org:aclaro Softworks, inc.
adr:;;1900 a - 11 St. SE;Calgary;Alberta;T2H 3G2;Canada email;internet:[email protected]
title:Software Developer
tel;work:(403) 299-6612
x-mozilla-html:FALSE
url:http://www.aclaro.com
version:2.1
end:vcard

#5 lore raw
In reply to Fabrice Bellard
Quoted 11 lines · Fabrice Bellard
Quoted 9 lines · Matthew Mastracci

Would it be possible to add a host/guest interface port, akin to how VMWare handles this? It's a convenient way to get/set various properties from the host while running the guest operating system. This also allows a smoother mouse interface - ie: auto capture/release of the mouse as it hits the screen boundaries, clipboard synchronization as well as synchronization of the guest's clock with the host's.

Some more info on the VMWare port is here:
http://chitchat.at.infoseek.co.jp/vmware/backdoor.html

Quoted 9 lines

Of course it is possible to add that, but first we must define the features we want and implement the necessary support in the guest OSes, which seems to be the most difficult AFAIK. Clipboard support would be interesting. Does anyone know how to implement it for Linux and Windows guests ?

Fabrice.

I volunteer to write the code for the Linux client if necessary. I'm studying the X11 clipboard mechanism anyways. I have a pretty good idea of how to get the clock of the host, also.

Not sure how auto-capture/release of mouse would work tho.

Quoted 5 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#6 lore raw
Quoted 7 lines · Jim C. Brown

I volunteer to write the code for the Linux client if necessary. I'm studying the X11 clipboard mechanism anyways. I have a pretty good idea of how to get the clock of the host, also.

Not sure how auto-capture/release of mouse would work tho.

Since the host knows exactly where the guest cursor is (the guest is sending cursor location updates), it can release the mouse when the guest cursor is against the edge of the screen. This works in reverse as well - when the mouse is moved over the QEMU screen, the host captures it (hiding the local cursor) and updates the guest location to match. It's a seamless transition from real mouse to virtual mouse.

The guest can also hide and show the guest OS cursor as it is captured/released. You'll only see the cursor in the guest if it is captured by QEMU.

Matt.

begin:vcard
fn:Matthew Mastracci
n:Mastracci;Matthew
org:aclaro Softworks, inc.
adr:;;1900 a - 11 St. SE;Calgary;Alberta;T2H 3G2;Canada email;internet:[email protected]
title:Software Developer
tel;work:(403) 299-6612
x-mozilla-html:FALSE
url:http://www.aclaro.com
version:2.1
end:vcard

#4 lore raw
In reply to Matthew Mastracci

I would prefer a network based solution first. Changing the interface to use a CPU specific hack won't be difficult in the future.

Fabrice.

Quoted 29 lines · Matthew Mastracci
Quoted 11 lines · Fabrice Bellard
Quoted 4 lines · Matthew Mastracci

Would it be possible to add a host/guest interface port, akin to how VMWare handles this? It's a convenient way to get/set various properties from the host while running the guest operating system. This also allows a smoother mouse interface - ie: auto capture/release of the mouse as it hits the screen boundaries, clipboard synchronization as well as synchronization of the guest's clock with the host's.

Some more info on the VMWare port is here:
http://chitchat.at.infoseek.co.jp/vmware/backdoor.html

Of course it is possible to add that, but first we must define the features we want and implement the necessary support in the guest OSes, which seems to be the most difficult AFAIK. Clipboard support would be interesting. Does anyone know how to implement it for Linux and Windows guests ?

I can implement text-clipboard-passing for a windows guest without much effort. If the CPU protection for the IO port is disabled, even when running at IOPL3, it could be implemented entirely in userspace.

It would be nice to define standard register values for the different features, as well as add functionality to query the availability of the feature. For instance, the first two registers could define the supported interface:

Register 0: Returns the maximum supported register index by the current version of QEMU
Register 1: Write to the register with a given register index - returns 1 if supported or 0 if unsupported or disabled.

Possible register functionality (off the top of my head):
- Get host clock: returns the host clock time in UTC (useful for clock sync between guest/host)
- Get host clock TZ: returns the host clock offset relative to UTC
- Set host's clipboard
- Get host's clipboard
- Attach/detach virtual device (floppy/cd/etc)
- Transfer file (?)
- Read guest filesystem

#7 lore raw
In reply to Matthew Mastracci
Quoted 7 lines · Matthew Mastracci

Since the host knows exactly where the guest cursor is (the guest is sending cursor location updates), it can release the mouse when the guest cursor is against the edge of the screen. This works in reverse as well - when the mouse is moved over the QEMU screen, the host captures it (hiding the local cursor) and updates the guest location to match. It's a seamless transition from real mouse to virtual mouse.

Quoted 6 lines

The guest can also hide and show the guest OS cursor as it is captured/released. You'll only see the cursor in the guest if it is captured by QEMU.

Matt.

This is tricky though, especially when you try to set the mouse to the spot where it enters the window.

I personally prefer the Synaptic Touchpad solution, since we won't need to grab the mouse at all that way. (Right now I'm using a patched qemu where the guest mouse follows the host mouse w/o using SDL grab, and sometimes it will go all over the place.)

Quoted 4 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://mail.nongnu.org/mailman/listinfo/qemu-devel

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.