Skip to content

Request for clipboard support #1

Description

@guru-irvine

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.

Activity

s-u commented on May 5, 2022

@s-u
Owner

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 commented on Nov 9, 2022

@s-u
Owner

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 commented on Nov 9, 2022

@s-u
Owner

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 commented on Feb 8, 2023

@benford-servicem8

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

s-u commented on Feb 8, 2023

@s-u
Owner

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions