Skip to content

445 vagrant up exits with status 1 for macvms#446

Closed
bineesh-n wants to merge 2 commits intomasterfrom
445-vagrant-up-exits-with-status-1-for-macvms
Closed

445 vagrant up exits with status 1 for macvms#446
bineesh-n wants to merge 2 commits intomasterfrom
445-vagrant-up-exits-with-status-1-for-macvms

Conversation

@bineesh-n
Copy link
Contributor

Made is_macvm a member of module since I was getting error in accessing the function from guest_cap. Since macvm is actually a darwin guest, darwin guest commands to share folders are getting executed. I skipped this in enable & disable functions for macvms.

@legal90 We need these changes within a week. Please review.

bineesh-n added 2 commits May 10, 2023 13:22
Making this change to access the module in guest_cap/darwin/*.rb
@bineesh-n bineesh-n requested a review from legal90 May 10, 2023 09:29
@bineesh-n bineesh-n linked an issue May 10, 2023 that may be closed by this pull request
@legal90
Copy link
Collaborator

legal90 commented May 10, 2023

Hi @bineesh-n !
I'll do my best to review and release it until the end of this week.

BTW, I finally got the chance to validate vagrant-parallels on Apple-series Macs. Could you please tell me if there are any public macvm boxes available? If not - is there some manual how to build the one locally (maybe using packer) ?

@bineesh-n
Copy link
Contributor Author

bineesh-n commented May 11, 2023

Hi @legal90 ,

I couldn't find any macvm boxes in public. We are using this document to create macvm box (https://fe.parallels.com/c6030b623488876684972a82869c9b30/PDFM-Creating%20a%20MacVM%20box%20(temporary%20method)-110523-042148.pdf [link expires in 30 days])

@legal90
Copy link
Collaborator

legal90 commented May 12, 2023

@bineesh-n Could you please try to update the usable? function in

def usable?(machine, raise_errors=false)
# These synced folders only work if the provider is Parallels
machine.provider_name == :parallels &&
machine.provider_config.functional_psf
end

to this:

      def usable?(machine, raise_errors=false)
        # These synced folders only work if the provider is Parallels and the guest is not *.macvm
        machine.provider_name == :parallels &&
          machine.provider_config.functional_psf &&
          !Util::Common::is_macvm(machine)
      end

If that works, then all other changes down in synced_folder.rb won't be needed.


@bineesh-n A side question about running macvm:
I built the macvm box and got the VM booted by vagrant up, but the provider fails to detect the VM IP because
prlctl list --full --json for this VM always returns "ip_configured": "-". Guest tools are installed.
Do you have any idea where to look at? Should I maybe file a support ticket?
Host OS: macOS 13.3.1 (Apple M2 Pro)
Guest OS: macOS 13.3.1 (Apple M2 Pro (Virtual))
PDfM version: Version 18.2.0 (53488)

@bineesh-n
Copy link
Contributor Author

@legal90 I'll make the changes now.

"prlctl list --full --json" will work for ip address in next release of PD only (soon).

@bineesh-n
Copy link
Contributor Author

@legal90 I tried the suggestion you provided, but now the system asks me smb password and configures SMB sharing instead. That's also failing.

Bringing machine 'default' up with 'parallels' provider...
==> default: Preparing SMB shared folders...
    default: You will be asked for the username and password to use for the SMB
    default: folders shortly. Please use the proper username/password of your
    default: account.
    default:
    default: Username (user[@domain]):
    default: Password (will be hidden):
Vagrant SMB synced folders require the account password to be stored
in an NT compatible format. Please update your sharing settings to
enable a Windows compatible password and try again.

@legal90
Copy link
Collaborator

legal90 commented May 12, 2023

@bineesh-n It seems that Vagrant tries to find any other usable approach for handling shared folders.
Is SMB not supported in *.macvm boxes too?
In that case I would suggest to put that either to the box built-in Vagrantfile or into the end-user Vagrantfile:

config.vm.synced_folder ".", "/vagrant", disabled: true

It should disable the default synced folder explicitly. Could you please check if that helps?

@bineesh-n
Copy link
Contributor Author

bineesh-n commented May 15, 2023

@legal90 we need to design vagrant-parallels to put the shared folder info in our config.pvs for macvms. But as per your current suggestion, we need to ask users to create box and disable default synced folder. So what about their custom shared folders ? It's not 'macvm' not supporting shared folders, but mounting and unmounting is not required this to work. Just putting entry in config.pvs is enough.

I tried your suggestion though. It shows following error.

1: from /Users/bineeshnadukkalam/.vagrant.d/gems/2.7.6/gems/vagrant-parallels-2.3.1/lib/vagrant-parallels/synced_folder.rb:10:in `usable?'
/Users/bineeshnadukkalam/.vagrant.d/gems/2.7.6/gems/vagrant-parallels-2.3.1/lib/vagrant-parallels/util/common.rb:9:in `is_macvm': undefined method `directory' for nil:NilClass (NoMethodError)

@legal90
Copy link
Collaborator

legal90 commented May 19, 2023

@bineesh-n ,

It's not 'macvm' not supporting shared folders, but mounting and unmounting is not required this to work. Just putting entry in config.pvs is enough.

Thank you! That makes sense now. Although, as I remember, it was not recommended to edit config.pvs, as it's "internal" configure and the structure might change. We should do it only as a last resort. And it's always better to implement that feature via prlctl (feature request to Parallels).
But if you are confident about the structure and want to make it working right now - feel free to do it via config.pvs and use this case as an example:

@logger.debug 'Converting linked clone to the regular VM'
config_pvs = File.join(@home_path, 'config.pvs')
xml = Nokogiri::XML(File.open(config_pvs))
xml.xpath('//ParallelsVirtualMachine/Identification/LinkedVmUuid').first.content = ''
xml.xpath('//ParallelsVirtualMachine/Identification/LinkedSnapshotUuid').first.content = ''
File.open(config_pvs, 'w') do |f|
f.write xml.to_xml
end

So what about their custom shared folders ?

Yes, that looks like a proper solution. We can implement it as yet another synced_folder instance, let's say :parallels_macvm or similar.

synced_folder(:parallels) do
require_relative 'synced_folder'
SyncedFolder
end

Overall, this PR looks OK for me now. Please let me know if you want me to merge it and release as is, or do you want to add synced folder implementation via config.pvs?

@legal90
Copy link
Collaborator

legal90 commented May 19, 2023

@bineesh-n I have created a dummy placeholder class for synced folders for *.macvms: #448
Could you please try it?

It should fix the issue #445 and it could be used as a starting point for the correct implementation of synced folder for *.macvms (with editing config.pvs, as we discussed above).

@bineesh-n bineesh-n deleted the 445-vagrant-up-exits-with-status-1-for-macvms branch May 24, 2023 10:36
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

Successfully merging this pull request may close these issues.

'vagrant up' exits with status 1 for macvms

2 participants