Comments (5)
Sorry, it's my problem. It's unfortunately I tried setting up two different static IPs, and they were both occupied repeatedly in vlan. Now it work.
from windows.
You can just use macvlan
mode with DHCP=N
. This will allow you to choose any IP you like, but the traffic will still be tunneled to the VM (this means Windows does not know what outside IP it has).
If for some reason you also really need Windows to know its own IP (normally there are no reasons for that), then you must set DHCP=Y
. But the name "DHCP" for the setting is a bit misleading, because what it really does is to create a macvtap
interface. And you will also need that interface if you want to assign a static IP on the network.
So in that case set DHCP=Y
, boot the container and then go inside the Window Control Panel and set a static IP for the network adaptor so that it ignores the DHCP server.
from windows.
When I use macvlan
mode with DHCP=Y
and enter ipconfig
on the cmd, it is shown as follows.
C:\Users\Docker\Desktop>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::4192:558f:7082:a7b1%12
IPv4 Address. . . . . . . . . . . : 172.22.108.102
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 172.22.108.254
Tunnel adapter isatap.{167133D2-1830-4B68-A65C-1A019F1A5D7B}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
So I use netsh interface ip set address "Ethernet" static 172.22.108.75 255.255.255.0 172.22.108.254
to modify the network configuration. But now it shows "no internet access" and I can't connect Windows via RDP.
from windows.
And this is my docker-compose.yml
version: "3"
services:
windows:
image: dockurr/windows
container_name: windows
environment:
DHCP: "Y"
volumes:
- ./2012.iso:/storage/custom.iso
- ./storage:/storage
devices:
- /dev/kvm
- /dev/vhost-net
device_cgroup_rules:
- 'c *:* rwm'
cap_add:
- NET_ADMIN
stop_grace_period: 2m
restart: on-failure
networks:
vlan:
ipv4_address: 172.22.108.98
networks:
vlan:
driver: macvlan
driver_opts:
parent: ens33
ipam:
config:
- subnet: "172.22.108.0/24"
ip_range: "172.22.108.0/24"
gateway: "172.22.108.254"
from windows.
I am not sure why.. I use the same network code in another project ( https://github.com/vdsm/virtual-dsm ) and I know for sure that it works there to set a static IP. Because macvtap
provides a direct connection to the network, it should not matter at all if you use dynamic or static IP. I never tested it with this container, I just expected it would work for Windows too since I cannot think of any reason why it would work with DSM (Linux) and not with Windows.
For a quick solution, wouldnt it be an alternative for you to just configure your DHCP server to give Windows the IP you want? That would solve your problem also.
from windows.
Related Issues (20)
- [Feature]: Request for adding the feature of customizing the MAC address of the virtual machine HOT 2
- [Solved] Can not share host folder with Windows container HOT 7
- Container do not start after reboot HOT 1
- Cannot open and connect from macOS.
- [Question]: Windows Networks Prompt HOT 1
- Custom ISO HOT 1
- [Question]: windows.3788177408.iso (containing windows.base inside) windows.rom windows.vars ? Help me :) HOT 1
- [Question]: use a vhdx into docker container HOT 10
- Always stuck on page "Setup is starting"
- Error when installing Windows
- [Question]: USB Passthrough Multiple Devices with the same Vendor & Product ID
- [Question]: Working with Apache Guacamole
- [Question]: RAM_SIZE less than 1GB HOT 1
- [Question]: Is it possible to set environemnt variables IN WINDOWS directly from docker compose? HOT 2
- setting a costum resolution not working
- Cannot access shared folder using samba
- Start up Error, RAM error
- [Feature]: Adding `QEMU Guest Agent` to Unattend XML
- Docker Compose NOT Using Existing Volume for Windows 10 Container
- Installation failing because of "KVM acceleration not available"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows.