Repository: code-ready/crc
Pull request #3308 (2022-08-22 10:16:23)

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
0. use the `msi` from this PR to install `crc`
1. run `crc config set enable-shared-dirs true` and follow the instructions from the validation msg (it should ask to configure `smb-share-password` first)
2. run `crc config set preset podman` and `crc setup`
3. `crc start` with podman preset and bundle from https://github.com/code-ready/snc/pull/565 should succeed (download from openshift CI artifacts)
4. container with a volume mount should work, e.g: `podman run -v /mnt/home/crc/conf:/etc/http/conf httpd`

openshift-ci[bot]: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from anjannath by writing `/assign @anjannath` in a comment. For more information see:[The Kubernetes Code Review Process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process).

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/code-ready/crc/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["anjannath"]} -->
anjannath: 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
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 6c86d34d830cbf98155615d25edac15281ec27ec | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1561749519886979072) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | 97fd7634f931cbc800f90782b5dcfacca362fc33 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1562348083507892224) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | 97fd7634f931cbc800f90782b5dcfacca362fc33 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1562348083507892224) | true | `/test integration-crc`
ci/prow/images | 97fd7634f931cbc800f90782b5dcfacca362fc33 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-images/1562348083474337792) | true | `/test images`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | 97fd7634f931cbc800f90782b5dcfacca362fc33 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1562348083507892224) | true | `/test integration-crc`
ci/prow/images | 97fd7634f931cbc800f90782b5dcfacca362fc33 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-images/1562348083474337792) | true | `/test images`
ci/prow/e2e-crc | 97fd7634f931cbc800f90782b5dcfacca362fc33 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1562348083440783360) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
anjannath: @gbraad PTAL
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | 526670c325e13ff03911c69eb2297d1b9e5e748e | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1562787421999861760) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/integration-crc | 526670c325e13ff03911c69eb2297d1b9e5e748e | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1562787421999861760) | true | `/test integration-crc`
ci/prow/images | 427a8cc8ad2c96fcfe71075dfd0bfc0c716acfc0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-images/1564312770042662912) | true | `/test images`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/images | 427a8cc8ad2c96fcfe71075dfd0bfc0c716acfc0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-images/1564312770042662912) | true | `/test images`
ci/prow/integration-crc | 427a8cc8ad2c96fcfe71075dfd0bfc0c716acfc0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1564312770080411648) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/images | 427a8cc8ad2c96fcfe71075dfd0bfc0c716acfc0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-images/1564312770042662912) | true | `/test images`
ci/prow/integration-crc | 427a8cc8ad2c96fcfe71075dfd0bfc0c716acfc0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1564312770080411648) | true | `/test integration-crc`
ci/prow/e2e-crc | 427a8cc8ad2c96fcfe71075dfd0bfc0c716acfc0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1564312769992331264) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
gbraad: 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.
openshift-merge-robot: @anjannath: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 49be8620b073435b267dad86092daf20ecd4d315 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1568194656347361280) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 49be8620b073435b267dad86092daf20ecd4d315 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1568194656347361280) | true | `/test e2e-crc`
ci/prow/integration-crc | 49be8620b073435b267dad86092daf20ecd4d315 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1568194656422858752) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 49be8620b073435b267dad86092daf20ecd4d315 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1568194656347361280) | true | `/test e2e-crc`
ci/prow/integration-crc | 49be8620b073435b267dad86092daf20ecd4d315 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1568194656422858752) | true | `/test integration-crc`
ci/prow/images | 49be8620b073435b267dad86092daf20ecd4d315 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-images/1568194656385110016) | true | `/test images`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 758f4f3bb19d0bfb13c91dad3b0a534e7defd8fd | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1568198730379694080) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
gbraad: 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
```
anjannath: > 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.
gbraad: > [temp: replace code-ready/machine with anjannath/machine](https://github.com/code-ready/crc/pull/3308/commits/9ea4955b555010fd8f00b1be7925ce4cafb3e402)

why?

anjannath: > > [temp: replace code-ready/machine with anjannath/machine](https://github.com/code-ready/crc/pull/3308/commits/9ea4955b555010fd8f00b1be7925ce4cafb3e402)
> 
> 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 
gbraad: > 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
anjannath: @cfergeau @gbraad All the review comments are addressed and changes have been made PTALA, thanks!!
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | bc9cd565c6cc2e916562d36a362434ab30c92159 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1575008156168228864) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
anjannath: PR rebased on top of #3333 
openshift-ci[bot]: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 2379463ff9d768c2e4aa3fba5957f6532732a0b0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1575438967606611968) | true | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | 2379463ff9d768c2e4aa3fba5957f6532732a0b0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1575438967606611968) | true | `/test e2e-crc`
ci/prow/integration-crc | 2379463ff9d768c2e4aa3fba5957f6532732a0b0 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1575438967682109440) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
ci/prow/e2e-crc | a58ab070e79df5b66e72301269ad9c7bd2f45ad7 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-e2e-crc/1575511337432256512) | true | `/test e2e-crc`
ci/prow/integration-crc | a58ab070e79df5b66e72301269ad9c7bd2f45ad7 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/3308/pull-ci-code-ready-crc-main-integration-crc/1575511337683914752) | true | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=3308). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/3308#pullrequestreview-1126126666" title="Approved">gbraad</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/main/OWNERS)~~ [gbraad]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
anjannath: /retest
anjannath: > Approved for podman bundle Unable to test for the OpenShift bundle
> 

tested with the new `4.11.7` openshift bundle and working as expected

openshift-ci[bot]: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/3308#pullrequestreview-1136263822" title="Approved">cfergeau</a>*, *<a href="https://github.com/code-ready/crc/pull/3308#pullrequestreview-1126126666" title="Approved">gbraad</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/main/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
</details>
<!-- META={"approvers":[]} -->
openshift-ci[bot]: New changes are detected. LGTM label has been removed.

Patch:
diff --git a/cmd/crc/cmd/start.go b/cmd/crc/cmd/start.go
index 5a5e01982..543aae415 100644
--- a/cmd/crc/cmd/start.go
+++ b/cmd/crc/cmd/start.go
@@ -75,9 +75,9 @@ func runStart(ctx context.Context) (*types.StartResult, error) {
 		PullSecret:        cluster.NewInteractivePullSecretLoader(config),
 		KubeAdminPassword: config.Get(crcConfig.KubeAdminPassword).AsString(),
 		Preset:            crcConfig.GetPreset(config),
-		EnableSharedDirs:  crcConfig.ShouldEnableSharedDirs(config),
 		IngressHTTPPort:   config.Get(crcConfig.IngressHTTPPort).AsUInt(),
 		IngressHTTPSPort:  config.Get(crcConfig.IngressHTTPSPort).AsUInt(),
+		EnableSharedDirs:  config.Get(crcConfig.EnableSharedDirs).AsBool(),
 	}
 
 	client := newMachine()
@@ -96,6 +96,17 @@ func runStart(ctx context.Context) (*types.StartResult, error) {
 		}
 	}
 
+	if runtime.GOOS == "windows" {
+		username, err := crcos.GetCurrentUsername()
+		if err != nil {
+			return nil, err
+		}
+
+		// config SharedDirPassword ('shared-dir-password') only exists in windows
+		startConfig.SharedDirPassword = config.Get(crcConfig.SharedDirPassword).AsString()
+		startConfig.SharedDirUsername = username
+	}
+
 	return client.Start(ctx, startConfig)
 }
 
diff --git a/go.mod b/go.mod
index 13bf6ea93..0f271b36d 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
 	github.com/cavaliergopher/grab/v3 v3.0.1
 	github.com/cheggaaa/pb/v3 v3.0.8
 	github.com/code-ready/admin-helper v0.0.10
-	github.com/code-ready/machine v0.0.0-20220727160217-7bf0dd8c2d7b
+	github.com/code-ready/machine v0.0.0-20220927132822-3408fdecc41c
 	github.com/code-ready/vfkit v0.0.2
 	github.com/containers/gvisor-tap-vsock v0.4.1-0.20220908123107-8d91f6d62de2
 	github.com/containers/image/v5 v5.15.0
diff --git a/go.sum b/go.sum
index 228517a79..fdbce68c5 100644
--- a/go.sum
+++ b/go.sum
@@ -243,8 +243,8 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC
 github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
 github.com/code-ready/admin-helper v0.0.10 h1:J7z6cu8owR9UemZlHQXL2W1aCOfo1nGhY1YtYz2+aCo=
 github.com/code-ready/admin-helper v0.0.10/go.mod h1:8ACGWyeBXkVcQ53idgXhYzLGrK/+xjabcGVCtPtKaRQ=
-github.com/code-ready/machine v0.0.0-20220727160217-7bf0dd8c2d7b h1:Eev9Enne43B+k6s2gfYxaSh0f0/+owLbrAyk8+7eoeM=
-github.com/code-ready/machine v0.0.0-20220727160217-7bf0dd8c2d7b/go.mod h1:zeUHkDy+CASmOmTcbvv9m5SlkXmhp0MAtcs6f7EMp68=
+github.com/code-ready/machine v0.0.0-20220927132822-3408fdecc41c h1:cVthP8D5RUFAegEqrVWXiHUwRR+0dqN0mdOGYU6RJwU=
+github.com/code-ready/machine v0.0.0-20220927132822-3408fdecc41c/go.mod h1:zeUHkDy+CASmOmTcbvv9m5SlkXmhp0MAtcs6f7EMp68=
 github.com/code-ready/vfkit v0.0.2 h1:DA7wnPVXjs8bwa3ksNd8JtKzXsZ1oC1F7JanVoDyzCw=
 github.com/code-ready/vfkit v0.0.2/go.mod h1:rjWQeMUISswhWXeBp5LEzwVjv8aN3Gn1QxIHDCmxu40=
 github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
diff --git a/packaging/windows/product.wxs.template b/packaging/windows/product.wxs.template
index 94b88f672..1de1c1f7b 100755
--- a/packaging/windows/product.wxs.template
+++ b/packaging/windows/product.wxs.template
@@ -38,6 +38,12 @@
                 Name="Path" />
         </Property>
 
+        <Property Id="USERFOLDER">
+            <DirectorySearch Id="userProfileSearch" Depth="0" Path="[%USERPROFILE]" />
+        </Property>
+
+        <Property Id="SHAREDDIRNAME" Secure="yes">crc-dir0</Property>
+
         <util:Group Id="CrcUsersGroup" Name="crc-users" />
         <Directory Id="TARGETDIR" Name="SourceDir">
             <Directory Id="ProgramFiles64Folder">
@@ -72,10 +78,10 @@
             </Directory>
             <Directory Id="ProgramMenuFolder">
                 <Component Id="StartMenuEntry" Guid="*">
-                    <Shortcut Id="TrayStartMenuEntry" 
-                            Name="Red Hat OpenShift Local" 
-                            Target="[INSTALLDIR]crc-tray.exe" 
-                            Icon="crcicon.ico" 
+                    <Shortcut Id="TrayStartMenuEntry"
+                            Name="Red Hat OpenShift Local"
+                            Target="[INSTALLDIR]crc-tray.exe"
+                            Icon="crcicon.ico"
                             WorkingDirectory="AppDataFolder">
                         <ShortcutProperty Key="System.AppUserModel.ID" Value="redhat.codereadycontainers.tray"/>
                     </Shortcut>
@@ -95,12 +101,24 @@
         <CustomAction Id="RemoveCrcDaemonTask" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no" Return="ignore" />
         <SetProperty Action="CAInstallHyperv" Id="InstallHyperv" Value='"[System64Folder]dism.exe" /online /enable-feature /featureName:microsoft-hyper-v-all /NoRestart /quiet' Before="InstallHyperv" Sequence="execute"/>
         <CustomAction Id="InstallHyperv" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="ignore" />
-        <SetProperty Action="CAAddUserToHypervAdminGroup" 
-            Id="AddUserToHypervAdminGroup" 
-            Value="&quot;[POWERSHELLEXE]&quot; -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command &quot;Add-LocalGroupMember -Member [LogonUser] -SID S-1-5-32-578&quot;" 
-            Before="AddUserToHypervAdminGroup" 
+        <SetProperty Action="CAAddUserToHypervAdminGroup"
+            Id="AddUserToHypervAdminGroup"
+            Value="&quot;[POWERSHELLEXE]&quot; -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command &quot;Add-LocalGroupMember -Member [LogonUser] -SID S-1-5-32-578&quot;"
+            Before="AddUserToHypervAdminGroup"
             Sequence="execute"/>
         <CustomAction Id="AddUserToHypervAdminGroup" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="ignore" />
+        <SetProperty Action="CACreateSMBShare"
+            Id="CreateSMBShare"
+            Value="&quot;[POWERSHELLEXE]&quot; -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command &quot;New-SmbShare -Name '[SHAREDDIRNAME]' -Path '[USERFOLDER]' -FullAccess '[LogonUser]'&quot;"
+            Before="CreateSMBShare"
+            Sequence="execute"/>
+        <CustomAction Id="CreateSMBShare" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="check" />
+        <SetProperty Action="CAEnableFileAndPrinterSharing"
+            Id="EnableFileAndPrinterSharing"
+            Value="&quot;[POWERSHELLEXE]&quot; -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command &quot;Set-NetFirewallRule -DisplayGroup 'File And Printer Sharing' -Enabled True -Profile 'Private,Public'&quot;"
+            Before="EnableFileAndPrinterSharing"
+            Sequence="execute"/>
+        <CustomAction Id="EnableFileAndPrinterSharing" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="check" />
 
         <util:CloseApplication Id = "TrayRunning" Description="Please exit Red Hat OpenShift Local from tray and run the installation again." Target="crc-tray.exe" RebootPrompt="no" PromptToContinue="yes" />
 
@@ -111,6 +129,8 @@
             <Custom Action="InstallHyperv" Before="CreateCrcGroup"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom>
             <Custom Action="RemoveCrcGroupRollback" After="CreateCrcGroup"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom>
             <Custom Action="RemoveCrcDaemonTask" Before='RemoveFiles'>Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
+            <Custom Action="EnableFileAndPrinterSharing" After="AddUserToHypervAdminGroup"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom>
+            <Custom Action="CreateSMBShare" After="EnableFileAndPrinterSharing"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom>
             <ScheduleReboot After="InstallFinalize"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</ScheduleReboot>
         </InstallExecuteSequence>
         <Feature Id="DefaultFeature" Level="1">
@@ -131,6 +151,8 @@
             <ProgressText Action="InstallHyperv">Installing Hyper-V</ProgressText>
             <ProgressText Action="AddUserToHypervAdminGroup">Adding user: [LogonUser] to Hyper-V Administrators group</ProgressText>
             <ProgressText Action="RemoveCrcDaemonTask">Removing crcDaemon task</ProgressText>
+            <ProgressText Action="CreateSMBShare">Creating share named: [SHAREDDIRNAME] for folder: [USERFOLDER]</ProgressText>
+            <ProgressText Action="EnableFileAndPrinterSharing">Enabling file and printer Sharing</ProgressText>
         </UI>
         <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
         <!-- this should help to propagate env var changes -->
diff --git a/pkg/crc/api/handlers.go b/pkg/crc/api/handlers.go
index edee6a2f5..a13975e5d 100644
--- a/pkg/crc/api/handlers.go
+++ b/pkg/crc/api/handlers.go
@@ -119,7 +119,7 @@ func getStartConfig(cfg crcConfig.Storage, args client.StartConfig) types.StartC
 		IngressHTTPPort:   cfg.Get(crcConfig.IngressHTTPPort).AsUInt(),
 		IngressHTTPSPort:  cfg.Get(crcConfig.IngressHTTPSPort).AsUInt(),
 		Preset:            crcConfig.GetPreset(cfg),
-		EnableSharedDirs:  crcConfig.ShouldEnableSharedDirs(cfg),
+		EnableSharedDirs:  cfg.Get(crcConfig.EnableSharedDirs).AsBool(),
 	}
 }
 
diff --git a/pkg/crc/config/callbacks.go b/pkg/crc/config/callbacks.go
index a95a38152..4ff7e03bf 100644
--- a/pkg/crc/config/callbacks.go
+++ b/pkg/crc/config/callbacks.go
@@ -33,6 +33,11 @@ func RequiresCRCSetup(key string, _ interface{}) string {
 		"Please run 'crc setup' for this configuration to take effect.", key)
 }
 
+func RequiresCleanupAndSetupMsg(key string, _ interface{}) string {
+	return fmt.Sprintf("Changes to configuration property '%s' are only applied during 'crc setup'.\n"+
+		"Please run 'crc cleanup' followed by 'crc setup' for this configuration to take effect.", key)
+}
+
 func RequiresHTTPPortChangeWarning(key string, value interface{}) string {
 	return fmt.Sprintf("Changes to configuration property '%s' will break OpenShift HTTP routes.\n"+
 		"In order to access OpenShift applications through HTTP URLs "+
diff --git a/pkg/crc/config/settings.go b/pkg/crc/config/settings.go
index 3c4545bd6..cb034a8ba 100644
--- a/pkg/crc/config/settings.go
+++ b/pkg/crc/config/settings.go
@@ -30,6 +30,7 @@ const (
 	KubeAdminPassword       = "kubeadmin-password"
 	Preset                  = "preset"
 	EnableSharedDirs        = "enable-shared-dirs"
+	SharedDirPassword       = "shared-dir-password" // #nosec G101
 	IngressHTTPPort         = "ingress-http-port"
 	IngressHTTPSPort        = "ingress-https-port"
 )
@@ -56,6 +57,17 @@ func RegisterSettings(cfg *Config) {
 		return ValidateBundlePath(value, GetPreset(cfg))
 	}
 
+	validateSmbSharedDirs := func(value interface{}) (bool, string) {
+		if !cfg.Get(HostNetworkAccess).AsBool() {
+			return false, fmt.Sprintf("%s can only be used with %s set to 'true'",
+				EnableSharedDirs, HostNetworkAccess)
+		}
+		if cfg.Get(SharedDirPassword).IsDefault {
+			return false, fmt.Sprintf("Please set '%s' first to enable shared directories", SharedDirPassword)
+		}
+		return ValidateBool(value)
+	}
+
 	// Preset setting should be on top because CPUs/Memory config depend on it.
 	cfg.AddSetting(Preset, string(preset.OpenShift), validatePreset, RequiresDeleteAndSetupMsg,
 		fmt.Sprintf("Virtual machine preset (valid values are: %s, %s and %s)", preset.Podman, preset.OpenShift, preset.OKD))
@@ -77,10 +89,17 @@ func RegisterSettings(cfg *Config) {
 		"Disable update check (true/false, default: false)")
 	cfg.AddSetting(ExperimentalFeatures, false, ValidateBool, SuccessfullyApplied,
 		"Enable experimental features (true/false, default: false)")
-	// shared dir is not implemented for windows yet
-	if runtime.GOOS == "darwin" || runtime.GOOS == "linux" {
+
+	// Shared directories configs
+	if runtime.GOOS == "windows" {
+		cfg.AddSetting(SharedDirPassword, Secret(""), ValidateString, SuccessfullyApplied,
+			"Password used while using CIFS/SMB file sharing (It is the password for the current logged in user)")
+
+		cfg.AddSetting(EnableSharedDirs, false, validateSmbSharedDirs, SuccessfullyApplied,
+			"Mounts host's user profile folder at '/' in the CRC VM (true/false, default: false)")
+	} else {
 		cfg.AddSetting(EnableSharedDirs, true, ValidateBool, SuccessfullyApplied,
-			"Enable shared directories which mounts host's $HOME at /home in the CRC VM (true/false, default: true)")
+			"Mounts host's home directory at '/' in the CRC VM (true/false, default: true)")
 	}
 
 	if !version.IsInstaller() {
@@ -88,7 +107,7 @@ func RegisterSettings(cfg *Config) {
 			fmt.Sprintf("Network mode (%s or %s)", network.UserNetworkingMode, network.SystemNetworkingMode))
 	}
 
-	cfg.AddSetting(HostNetworkAccess, false, validateHostNetworkAccess, SuccessfullyApplied,
+	cfg.AddSetting(HostNetworkAccess, false, validateHostNetworkAccess, RequiresCleanupAndSetupMsg,
 		"Allow TCP/IP connections from the CRC VM to services running on the host (true/false, default: false)")
 	// Proxy Configuration
 	cfg.AddSetting(HTTPProxy, "", ValidateHTTPProxy, SuccessfullyApplied,
@@ -145,14 +164,6 @@ func GetNetworkMode(config Storage) network.Mode {
 	return network.ParseMode(config.Get(NetworkMode).AsString())
 }
 
-func ShouldEnableSharedDirs(config Storage) bool {
-	// Shared dirs are not implemented for windows
-	if runtime.GOOS == "windows" {
-		return false
-	}
-	return config.Get(EnableSharedDirs).AsBool()
-}
-
 func UpdateDefaults(cfg *Config) {
 	RegisterSettings(cfg)
 }
diff --git a/pkg/crc/errors/maskederror.go b/pkg/crc/errors/maskederror.go
new file mode 100755
index 000000000..e83a3012f
--- /dev/null
+++ b/pkg/crc/errors/maskederror.go
@@ -0,0 +1,16 @@
+package errors
+
+import (
+	"strings"
+)
+
+const mask = "*****"
+
+type MaskedSecretError struct {
+	Err    error
+	Secret string
+}
+
+func (err *MaskedSecretError) Error() string {
+	return strings.ReplaceAll(err.Err.Error(), err.Secret, mask)
+}
diff --git a/pkg/crc/machine/config/config.go b/pkg/crc/machine/config/config.go
index a419b1751..c8a99d6aa 100644
--- a/pkg/crc/machine/config/config.go
+++ b/pkg/crc/machine/config/config.go
@@ -7,15 +7,17 @@ type MachineConfig struct {
 	BundleName string
 
 	// Virtual machine configuration
-	Name            string
-	Memory          int
-	CPUs            int
-	DiskSize        int
-	ImageSourcePath string
-	ImageFormat     string
-	SSHKeyPath      string
-	KubeConfig      string
-	SharedDirs      []string
+	Name              string
+	Memory            int
+	CPUs              int
+	DiskSize          int
+	ImageSourcePath   string
+	ImageFormat       string
+	SSHKeyPath        string
+	KubeConfig        string
+	SharedDirs        []string
+	SharedDirPassword string
+	SharedDirUsername string
 
 	// macOS specific configuration
 	KernelCmdLine string
diff --git a/pkg/crc/machine/config/driver.go b/pkg/crc/machine/config/driver.go
index f4277edb1..a18050800 100644
--- a/pkg/crc/machine/config/driver.go
+++ b/pkg/crc/machine/config/driver.go
@@ -1,8 +1,6 @@
 package config
 
 import (
-	"fmt"
-
 	"github.com/code-ready/machine/libmachine/drivers"
 )
 
@@ -17,13 +15,4 @@ func InitVMDriverFromMachineConfig(machineConfig MachineConfig, driver *drivers.
 	driver.BundleName = machineConfig.BundleName
 	driver.ImageSourcePath = machineConfig.ImageSourcePath
 	driver.ImageFormat = machineConfig.ImageFormat
-
-	for i, dir := range machineConfig.SharedDirs {
-		sharedDir := drivers.SharedDir{
-			Source: dir,
-			Target: dir,
-			Tag:    fmt.Sprintf("dir%d", i),
-		}
-		driver.SharedDirs = append(driver.SharedDirs, sharedDir)
-	}
 }
diff --git a/pkg/crc/machine/driver.go b/pkg/crc/machine/driver.go
index 249265bf3..1a998e6ff 100644
--- a/pkg/crc/machine/driver.go
+++ b/pkg/crc/machine/driver.go
@@ -57,3 +57,19 @@ func setDiskSize(host *host.Host, diskSizeGiB int) error {
 
 	return updateDriverValue(host, diskSizeSetter)
 }
+
+func setSharedDirPassword(host *host.Host, password string) error {
+	driver, err := loadDriverConfig(host)
+	if err != nil {
+		return err
+	}
+
+	if len(driver.SharedDirs) == 0 {
+		return nil
+	}
+
+	for i := range driver.SharedDirs {
+		driver.SharedDirs[i].Password = password
+	}
+	return updateDriverStruct(host, driver)
+}
diff --git a/pkg/crc/machine/driver_darwin.go b/pkg/crc/machine/driver_darwin.go
index b2de33c8c..e4ea303d8 100644
--- a/pkg/crc/machine/driver_darwin.go
+++ b/pkg/crc/machine/driver_darwin.go
@@ -11,6 +11,7 @@ import (
 	machineVf "github.com/code-ready/crc/pkg/drivers/vfkit"
 	"github.com/code-ready/crc/pkg/libmachine"
 	"github.com/code-ready/crc/pkg/libmachine/host"
+	"github.com/code-ready/machine/libmachine/drivers"
 )
 
 func newHost(api libmachine.API, machineConfig config.MachineConfig) (*host.Host, error) {
@@ -64,3 +65,7 @@ func updateKernelArgs(vm *virtualMachine) error {
 	}
 	return vm.api.Save(vm.Host)
 }
+
+func updateDriverStruct(host *host.Host, driver *machineVf.Driver) error {
+	return drivers.ErrNotImplemented
+}
diff --git a/pkg/crc/machine/driver_linux.go b/pkg/crc/machine/driver_linux.go
index 9805696ad..ccbd1fa37 100644
--- a/pkg/crc/machine/driver_linux.go
+++ b/pkg/crc/machine/driver_linux.go
@@ -10,6 +10,7 @@ import (
 	"github.com/code-ready/crc/pkg/libmachine"
 	"github.com/code-ready/crc/pkg/libmachine/host"
 	machineLibvirt "github.com/code-ready/machine/drivers/libvirt"
+	"github.com/code-ready/machine/libmachine/drivers"
 )
 
 func newHost(api libmachine.API, machineConfig config.MachineConfig) (*host.Host, error) {
@@ -47,3 +48,7 @@ func (r *RPCServerDriver) SetConfigRaw(data []byte, _ *struct{}) error {
 	return json.Unmarshal(data, &r.ActualDriver)
 }
 */
+
+func updateDriverStruct(host *host.Host, driver *machineLibvirt.Driver) error {
+	return drivers.ErrNotImplemented
+}
diff --git a/pkg/crc/machine/driver_windows.go b/pkg/crc/machine/driver_windows.go
index 95d1a9422..dec7fae0e 100644
--- a/pkg/crc/machine/driver_windows.go
+++ b/pkg/crc/machine/driver_windows.go
@@ -37,3 +37,8 @@ func updateDriverConfig(host *host.Host, driver *machineHyperv.Driver) error {
 func updateKernelArgs(vm *virtualMachine) error {
 	return nil
 }
+
+func updateDriverStruct(host *host.Host, driver *machineHyperv.Driver) error {
+	host.Driver = driver
+	return nil
+}
diff --git a/pkg/crc/machine/hyperv/driver_windows.go b/pkg/crc/machine/hyperv/driver_windows.go
index 85ba5fa29..9d5f42195 100644
--- a/pkg/crc/machine/hyperv/driver_windows.go
+++ b/pkg/crc/machine/hyperv/driver_windows.go
@@ -1,11 +1,15 @@
 package hyperv
 
 import (
+	"path/filepath"
+	"strings"
+
 	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/machine/config"
 	"github.com/code-ready/crc/pkg/crc/network"
 	"github.com/code-ready/crc/pkg/drivers/hyperv"
 	winnet "github.com/code-ready/crc/pkg/os/windows/network"
+	"github.com/code-ready/machine/libmachine/drivers"
 )
 
 func CreateHost(machineConfig config.MachineConfig) *hyperv.Driver {
@@ -23,5 +27,35 @@ func CreateHost(machineConfig config.MachineConfig) *hyperv.Driver {
 		hypervDriver.VirtualSwitch = switchName
 	}
 
+	hypervDriver.SharedDirs = configureShareDirs(machineConfig)
 	return hypervDriver
 }
+
+// converts a path like c:\users\crc to /mnt/c/users/crc
+func convertToUnixPath(path string) string {
+	/* podman internally converts windows style paths like C:\Users\crc  to
+	 * /mnt/c/Users/crc so it expects the shared folder to be mounted under
+	 * '/mnt' instead of '/' like in the case of macOS and linux
+	 * see: https://github.com/containers/podman/blob/468aa6478c73e4acd8708ce8bb0bb5a056f329c2/pkg/specgen/winpath.go#L24-L59
+	 */
+	path = filepath.ToSlash(path)
+	if len(path) > 1 && path[1] == ':' {
+		return ("/mnt/" + strings.ToLower(path[0:1]) + path[2:])
+	}
+	return path
+}
+
+func configureShareDirs(machineConfig config.MachineConfig) []drivers.SharedDir {
+	var sharedDirs []drivers.SharedDir
+	for _, dir := range machineConfig.SharedDirs {
+		sharedDir := drivers.SharedDir{
+			Source:   dir,
+			Target:   convertToUnixPath(dir),
+			Tag:      "crc-dir0", // smb share 'crc-dir0' is created in the msi
+			Type:     "cifs",
+			Username: machineConfig.SharedDirUsername,
+		}
+		sharedDirs = append(sharedDirs, sharedDir)
+	}
+	return sharedDirs
+}
diff --git a/pkg/crc/machine/libvirt/driver_linux.go b/pkg/crc/machine/libvirt/driver_linux.go
index 1a3cbb028..a79860e91 100644
--- a/pkg/crc/machine/libvirt/driver_linux.go
+++ b/pkg/crc/machine/libvirt/driver_linux.go
@@ -1,10 +1,13 @@
 package libvirt
 
 import (
+	"fmt"
+
 	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/machine/config"
 	"github.com/code-ready/crc/pkg/crc/network"
 	"github.com/code-ready/machine/drivers/libvirt"
+	"github.com/code-ready/machine/libmachine/drivers"
 )
 
 func CreateHost(machineConfig config.MachineConfig) *libvirt.Driver {
@@ -20,5 +23,21 @@ func CreateHost(machineConfig config.MachineConfig) *libvirt.Driver {
 	}
 
 	libvirtDriver.StoragePool = DefaultStoragePool
+	libvirtDriver.SharedDirs = configureShareDirs(machineConfig)
+
 	return libvirtDriver
 }
+
+func configureShareDirs(machineConfig config.MachineConfig) []drivers.SharedDir {
+	var sharedDirs []drivers.SharedDir
+	for i, dir := range machineConfig.SharedDirs {
+		sharedDir := drivers.SharedDir{
+			Source: dir,
+			Target: dir,
+			Tag:    fmt.Sprintf("dir%d", i),
+			Type:   "virtiofs",
+		}
+		sharedDirs = append(sharedDirs, sharedDir)
+	}
+	return sharedDirs
+}
diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go
index 07eacd889..6a97bd5b7 100644
--- a/pkg/crc/machine/start.go
+++ b/pkg/crc/machine/start.go
@@ -99,6 +99,14 @@ func (client *client) updateVMConfig(startConfig types.StartConfig, vm *virtualM
 		}
 	}
 
+	// we want to set the shared dir password on-the-fly to be used
+	// we do not want this value to be persisted to disk
+	if startConfig.SharedDirPassword != "" {
+		if err := setSharedDirPassword(vm.Host, startConfig.SharedDirPassword); err != nil {
+			return fmt.Errorf("Failed to set shared dir password: %w", err)
+		}
+	}
+
 	return nil
 }
 
@@ -173,10 +181,22 @@ func configureSharedDirs(vm *virtualMachine, sshRunner *crcssh.Runner) error {
 			}
 		}
 		logging.Debugf("Mounting tag %s at %s", mount.Tag, mount.Target)
-		//FIXME: do not hardcode this
-		mount.Type = "virtiofs"
-		if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Mounting %s", mount.Target), "mount", "-o", "context=\"system_u:object_r:container_file_t:s0\"", "-t", mount.Type, mount.Tag, mount.Target); err != nil {
-			return err
+		switch mount.Type {
+		case "virtiofs":
+			if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Mounting %s", mount.Target), "mount", "-o", "context=\"system_u:object_r:container_file_t:s0\"", "-t", mount.Type, mount.Tag, mount.Target); err != nil {
+				return err
+			}
+		case "cifs":
+			smbUncPath := fmt.Sprintf("//%s/%s", hostVirtualIP, mount.Tag)
+			if _, _, err := sshRunner.RunPrivate("sudo", "mount", "-o", fmt.Sprintf("rw,uid=core,gid=core,username='%s',password='%s'", mount.Username, mount.Password), "-t", mount.Type, smbUncPath, mount.Target); err != nil {
+				err = &crcerrors.MaskedSecretError{
+					Err:    err,
+					Secret: mount.Password,
+				}
+				return fmt.Errorf("Failed to mount CIFS/SMB share '%s' please make sure configured password is correct: %w", mount.Tag, err)
+			}
+		default:
+			return fmt.Errorf("Unknown Shared dir type requested: %s", mount.Type)
 		}
 	}
 
@@ -230,19 +250,21 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
 		}
 
 		machineConfig := config.MachineConfig{
-			Name:            client.name,
-			BundleName:      bundleName,
-			CPUs:            startConfig.CPUs,
-			Memory:          startConfig.Memory,
-			DiskSize:        startConfig.DiskSize,
-			NetworkMode:     client.networkMode(),
-			ImageSourcePath: crcBundleMetadata.GetDiskImagePath(),
-			ImageFormat:     crcBundleMetadata.GetDiskImageFormat(),
-			SSHKeyPath:      crcBundleMetadata.GetSSHKeyPath(),
-			KernelCmdLine:   crcBundleMetadata.GetKernelCommandLine(),
-			Initramfs:       crcBundleMetadata.GetInitramfsPath(),
-			Kernel:          crcBundleMetadata.GetKernelPath(),
-			SharedDirs:      sharedDirs,
+			Name:              client.name,
+			BundleName:        bundleName,
+			CPUs:              startConfig.CPUs,
+			Memory:            startConfig.Memory,
+			DiskSize:          startConfig.DiskSize,
+			NetworkMode:       client.networkMode(),
+			ImageSourcePath:   crcBundleMetadata.GetDiskImagePath(),
+			ImageFormat:       crcBundleMetadata.GetDiskImageFormat(),
+			SSHKeyPath:        crcBundleMetadata.GetSSHKeyPath(),
+			KernelCmdLine:     crcBundleMetadata.GetKernelCommandLine(),
+			Initramfs:         crcBundleMetadata.GetInitramfsPath(),
+			Kernel:            crcBundleMetadata.GetKernelPath(),
+			SharedDirs:        sharedDirs,
+			SharedDirPassword: startConfig.SharedDirPassword,
+			SharedDirUsername: startConfig.SharedDirUsername,
 		}
 		if crcBundleMetadata.IsOpenShift() {
 			machineConfig.KubeConfig = crcBundleMetadata.GetKubeConfigPath()
diff --git a/pkg/crc/machine/types/types.go b/pkg/crc/machine/types/types.go
index 13f5d27e2..5cf55f684 100644
--- a/pkg/crc/machine/types/types.go
+++ b/pkg/crc/machine/types/types.go
@@ -30,7 +30,9 @@ type StartConfig struct {
 	Preset crcpreset.Preset
 
 	// Shared dirs
-	EnableSharedDirs bool
+	EnableSharedDirs  bool
+	SharedDirPassword string
+	SharedDirUsername string
 
 	// Ports to access openshift routes
 	IngressHTTPPort  uint
diff --git a/pkg/crc/machine/vfkit/driver_darwin.go b/pkg/crc/machine/vfkit/driver_darwin.go
index fe90da8e4..cb6c8a4c3 100644
--- a/pkg/crc/machine/vfkit/driver_darwin.go
+++ b/pkg/crc/machine/vfkit/driver_darwin.go
@@ -1,12 +1,14 @@
 package vfkit
 
 import (
+	"fmt"
 	"path/filepath"
 
 	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/machine/config"
 	"github.com/code-ready/crc/pkg/crc/network"
 	"github.com/code-ready/crc/pkg/drivers/vfkit"
+	"github.com/code-ready/machine/libmachine/drivers"
 )
 
 func CreateHost(machineConfig config.MachineConfig) *vfkit.Driver {
@@ -22,5 +24,21 @@ func CreateHost(machineConfig config.MachineConfig) *vfkit.Driver {
 	vfDriver.VirtioNet = machineConfig.NetworkMode == network.SystemNetworkingMode
 	vfDriver.VsockPath = constants.TapSocketPath
 
+	vfDriver.SharedDirs = configureShareDirs(machineConfig)
+
 	return vfDriver
 }
+
+func configureShareDirs(machineConfig config.MachineConfig) []drivers.SharedDir {
+	var sharedDirs []drivers.SharedDir
+	for i, dir := range machineConfig.SharedDirs {
+		sharedDir := drivers.SharedDir{
+			Source: dir,
+			Target: dir,
+			Tag:    fmt.Sprintf("dir%d", i),
+			Type:   "virtiofs",
+		}
+		sharedDirs = append(sharedDirs, sharedDir)
+	}
+	return sharedDirs
+}
diff --git a/pkg/crc/machine/vsock.go b/pkg/crc/machine/vsock.go
index 4060d96e5..d5c11c5c8 100644
--- a/pkg/crc/machine/vsock.go
+++ b/pkg/crc/machine/vsock.go
@@ -76,6 +76,7 @@ func listOpenPorts(daemonClient *daemonclient.Client) ([]types.ExposeRequest, er
 
 const (
 	virtualMachineIP = "192.168.127.2"
+	hostVirtualIP    = "192.168.127.254"
 	internalSSHPort  = "22"
 	localIP          = "127.0.0.1"
 	remoteHTTPPort   = "80"
diff --git a/pkg/drivers/hyperv/hyperv_windows.go b/pkg/drivers/hyperv/hyperv_windows.go
index c8ed43500..654589fad 100644
--- a/pkg/drivers/hyperv/hyperv_windows.go
+++ b/pkg/drivers/hyperv/hyperv_windows.go
@@ -373,3 +373,12 @@ func (d *Driver) GetIP() (string, error) {
 
 	return resp[0], nil
 }
+
+func (d *Driver) GetSharedDirs() ([]drivers.SharedDir, error) {
+	for _, dir := range d.SharedDirs {
+		if !smbShareExists(dir.Tag) {
+			return []drivers.SharedDir{}, nil
+		}
+	}
+	return d.SharedDirs, nil
+}
diff --git a/pkg/drivers/hyperv/powershell_windows.go b/pkg/drivers/hyperv/powershell_windows.go
index eca262c32..7389ec168 100644
--- a/pkg/drivers/hyperv/powershell_windows.go
+++ b/pkg/drivers/hyperv/powershell_windows.go
@@ -95,3 +95,10 @@ func quote(text string) string {
 func toMb(value int) string {
 	return fmt.Sprintf("%dMB", value)
 }
+
+func smbShareExists(name string) bool {
+	if err := cmd(fmt.Sprintf("Get-SmbShare -Name %s", name)); err != nil {
+		return false
+	}
+	return true
+}
diff --git a/pkg/os/util_unix.go b/pkg/os/util_unix.go
index fdfbe08c8..1110e09b9 100644
--- a/pkg/os/util_unix.go
+++ b/pkg/os/util_unix.go
@@ -8,6 +8,7 @@ import (
 	"fmt"
 	"os"
 	"os/exec"
+	"os/user"
 	"strconv"
 	"strings"
 
@@ -37,3 +38,11 @@ func RemoveFileAsRoot(reason, filepath string) error {
 	_, _, err := RunPrivileged(reason, "rm", "-fr", filepath)
 	return err
 }
+
+func GetCurrentUsername() (string, error) {
+	u, err := user.Current()
+	if err != nil {
+		return "", err
+	}
+	return u.Username, nil
+}
diff --git a/pkg/os/util_windows.go b/pkg/os/util_windows.go
index a34a15c9d..7371a9d82 100644
--- a/pkg/os/util_windows.go
+++ b/pkg/os/util_windows.go
@@ -2,7 +2,10 @@ package os
 
 import (
 	"bytes"
+	"errors"
 	"io/ioutil"
+	"os/user"
+	"strings"
 
 	"golang.org/x/text/encoding/unicode"
 	"golang.org/x/text/transform"
@@ -28,3 +31,15 @@ func ReadFileUTF16LE(filename string) ([]byte, error) {
 	decoded, err := ioutil.ReadAll(unicodeReader)
 	return decoded, err
 }
+
+func GetCurrentUsername() (string, error) {
+	u, err := user.Current()
+	if err != nil {
+		return "", err
+	}
+	userAndDomain := strings.Split(u.Username, "\\")
+	if len(userAndDomain) > 1 {
+		return userAndDomain[1], nil
+	}
+	return "", errors.New("unable to find the username of current user")
+}
diff --git a/vendor/github.com/code-ready/machine/libmachine/drivers/base.go b/vendor/github.com/code-ready/machine/libmachine/drivers/base.go
index be8cbbfdc..085b3e81e 100644
--- a/vendor/github.com/code-ready/machine/libmachine/drivers/base.go
+++ b/vendor/github.com/code-ready/machine/libmachine/drivers/base.go
@@ -30,6 +30,8 @@ type SharedDir struct {
 	Tag      string
 	Target   string
 	Type     string
+	Username string
+	Password string `json:"-"`
 }
 
 // DriverName returns the name of the driver
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 6e6555758..6a8172dc0 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -82,7 +82,7 @@ github.com/cheggaaa/pb/v3/termutil
 github.com/code-ready/admin-helper/pkg/client
 github.com/code-ready/admin-helper/pkg/hosts
 github.com/code-ready/admin-helper/pkg/types
-# github.com/code-ready/machine v0.0.0-20220727160217-7bf0dd8c2d7b
+# github.com/code-ready/machine v0.0.0-20220927132822-3408fdecc41c
 ## explicit; go 1.17
 github.com/code-ready/machine/drivers/libvirt
 github.com/code-ready/machine/libmachine/drivers


Test patch:
diff --git a/pkg/crc/api/api_client_test.go b/pkg/crc/api/api_client_test.go
index 0827efb8f..cd02aa2d5 100644
--- a/pkg/crc/api/api_client_test.go
+++ b/pkg/crc/api/api_client_test.go
@@ -185,6 +185,11 @@ func TestConfigGetAll(t *testing.T) {
 	assert.NoError(t, err)
 	configs := make(map[string]interface{})
 	for k, v := range client.config.AllConfigs() {
+		// since we filter out secret configs at the config api handler level
+		// we need exclude them from AllConfigs
+		if v.IsSecret {
+			continue
+		}
 		// This is required because of https://pkg.go.dev/encoding/json#Unmarshal
 		// Unmarshal stores float64 for JSON numbers in case of interface.
 		switch v := v.Value.(type) {
diff --git a/pkg/crc/errors/maskederror_test.go b/pkg/crc/errors/maskederror_test.go
new file mode 100755
index 000000000..879bfb9bb
--- /dev/null
+++ b/pkg/crc/errors/maskederror_test.go
@@ -0,0 +1,16 @@
+package errors
+
+import (
+	"errors"
+	"fmt"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestMaskedError(t *testing.T) {
+	err := errors.New("The password is: pass@122")
+	maskedErr := &MaskedSecretError{err, "pass@122"}
+	expectedErrMsg := fmt.Sprintf("The password is: %s", mask)
+	assert.EqualError(t, maskedErr, expectedErrMsg)
+}
diff --git a/pkg/crc/machine/hyperv/driver_windows_test.go b/pkg/crc/machine/hyperv/driver_windows_test.go
new file mode 100755
index 000000000..b331204e4
--- /dev/null
+++ b/pkg/crc/machine/hyperv/driver_windows_test.go
@@ -0,0 +1,12 @@
+package hyperv
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestConvertToUnixPath(t *testing.T) {
+	assert.Equal(t, "/mnt/c/Users/crc", convertToUnixPath("C:\\Users\\crc"))
+	assert.Equal(t, "/mnt/d/Users/crc", convertToUnixPath("d:\\Users\\crc"))
+}