Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for clipboard support #1

Open
guru-irvine opened this issue Dec 11, 2021 · 5 comments
Open

Request for clipboard support #1

guru-irvine opened this issue Dec 11, 2021 · 5 comments

Comments

@guru-irvine
Copy link

guru-irvine commented Dec 11, 2021

First of all a very big "THANK YOU" for creating this wrapper to virtualization framework. In fact, this wrapper has good number of features (including changing of screen resolution, storage size, CPU, memory etc...) that I was not able to find in other commercial applications.

When you get a chance, please look at the possibility of sharing the clipboard from the host mac os to guest mac os.

Thank you so much in advance,
Guru R.

@s-u
Copy link
Owner

s-u commented May 5, 2022

I appreciate the idea, but the VZ framework itself does not support this, unfortunately. With some luck, Apple may simply add this to the VZ framework in one of the next macOS releases as this would be really easy for them.

In the meantime, it is possible to work around this by writing and installing "guest tools" in the guest OS. One way to do that is to use the virtual socket API to allow communication between the host and guest. macosvm can create a virtual socket that the guess tool can connect to and use this to communicate - one of the possible things to communicate is the pasteboard content which can be acquired by the GUI part of macosvm.

So this requires two pieces: the support in macosvm and a guest tool that has to be installed on in the guest OS. I have started a feature/guest-tools branch that explores the idea, but it will require some more work to implement the clipboard passing.

@s-u
Copy link
Owner

s-u commented Nov 9, 2022

macOS 13 has introduced clipboard sharing support to the VZ framework, but, unfortunately, this is only intended for Linux guests via the SPICE agent protocol and I'm not aware of any support on macOS guests for this. So we are back to the part where we need to implement guest tools - essentially we need a macOS port of the clipboard part of spice-vdagent in order to use this. So this doesn't actually help, but given the direction maybe macOS 14 will introduce native macOS clipboard sharing...

@s-u
Copy link
Owner

s-u commented Nov 9, 2022

Bad news: quick test suggests that this doesn't work for macOS guests at all. Even though the device /dev/tty.com.redhat.spice.0 shows up, simply calling open on it aborts the VM with an internal error (macOS 13 host+guest):

VM <VZVirtualMachine: 0x600002150c30> didStopWithError:
  Error Domain=VZErrorDomain
  Code=1 "The virtual machine stopped unexpectedly."
  UserInfo={NSLocalizedFailure=Internal Virtualization error.,
     NSLocalizedFailureReason=The virtual machine stopped unexpectedly.}

@benford-servicem8
Copy link

Easy workaround is to enable screen sharing in macOS, then connect to the VM and you get clipboard sharing.

@s-u
Copy link
Owner

s-u commented Feb 8, 2023

@benford-servicem8 thanks, yes, correct, that's why I am recommending that approach in the README - I pretty much never use the -g option other than for the initial installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants