crc
crc copied to clipboard
Add CIFS/SMB based file sharing for windows
Needs https://github.com/code-ready/machine/pull/66
Solution/Idea
the default CIFS/SMB feature provided from windows can be used to share directories over the network we can use it to share files between host and crc vm
Adds the following config options:
enable-shared-dirs(was present on macOS and linux now added to windows)smb-share-password
Testing
- use the
msifrom this PR to installcrc - run
crc config set enable-shared-dirs trueand follow the instructions from the validation msg (it should ask to configuresmb-share-passwordfirst) - run
crc config set preset podmanandcrc setup crc startwith podman preset and bundle from https://github.com/code-ready/snc/pull/565 should succeed (download from openshift CI artifacts)- container with a volume mount should work, e.g:
podman run -v /mnt/home/crc/conf:/etc/http/conf httpd
still need to test on a clean vm if the msi is able to set everything up, and also verify the assumption that Private network profile has "File and Printer Sharing" enabled by default on window 10
@gbraad PTAL
Just based on some of the comments from Christophe I say there is still some open issues; code re-use, IP address for use, etc.
Unable to build:
$ make cross
GOARCH=arm64 GOOS=darwin go build -tags "containers_image_openpgp" -ldflags="-X github.com/code-ready/crc/pkg/crc/version.crcVersion=2.8.0 -X github.com/code-ready/crc/pkg/crc/version.oc
pVersion=4.11.1 -X github.com/code-ready/crc/pkg/crc/version.okdVersion=4.11.0-0.okd-2022-08-20-022919 -X github.com/code-ready/crc/pkg/crc/version.podmanVersion=4.1.1 -X github.com/code-ready/crc/pkg/crc/version.commitSha=758f4f3bb " -o out/macos-arm64/crc ./cmd/crc package github.com/code-ready/crc/cmd/crc
imports github.com/code-ready/crc/cmd/crc/cmd
imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork
imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp
imports github.com/containers/gvisor-tap-vsock/pkg/tap
imports gvisor.dev/gvisor/pkg/tcpip
imports gvisor.dev/gvisor/pkg/atomicbitops
imports gvisor.dev/gvisor/pkg/state
imports gvisor.dev/gvisor/pkg/state/wire
imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /workspaces/crc/vendor/gvisor.dev/gvisor/pkg/gohacks
make: *** [Makefile:94: out/macos-arm64/crc] Error 1
on go version go1.19.1 linux/amd64 on Ubuntu it seems. Reverting to go version go1.18.3 linux/amd64 on Fedora
on go version go1.19.1 linux/amd64 on Ubuntu it seems. Reverting to go version go1.18.3 linux/amd64 on Fedora
~yes, i think 1.18 will also have issues, we are still on go 1.17 because of https://github.com/code-ready/crc/pull/3343#issuecomment-1245099348~
~RHEL-8 still have 1.17.12 version of golang in official repo and also as part of go toolset images https://catalog.redhat.com/software/containers/ubi8/go-toolset/5ce8713aac3db925c03774d1 . Internally brew build might fails with those changes.~
This was already fixed in main by https://github.com/code-ready/crc/pull/3341 just needed needed rebase
why?
we need to modify the SharedDir struct, the PR: https://github.com/code-ready/machine/pull/66 on machine repo needs to be merged and then we can remove this commit
use the msi from this PR to install crc
can you describe steps needed to test this without the MSI too? This is also suggested for: https://github.com/code-ready/crc/pull/3308#discussion_r980743590
@cfergeau @gbraad All the review comments are addressed and changes have been made PTALA, thanks!!
PR rebased on top of #3333
/retest
Approved for podman bundle Unable to test for the OpenShift bundle
tested with the new 4.11.7 openshift bundle and working as expected
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: cfergeau, gbraad
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [cfergeau,gbraad]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
New changes are detected. LGTM label has been removed.