mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-07-28 18:54:47 +08:00
Compare commits
No commits in common. "c96fafa26fce50c66c64edd437445cf2b6309628" and "a1d0bd167d66910ce6ae53385be008b1f4cb06f7" have entirely different histories.
c96fafa26f
...
a1d0bd167d
@ -72,7 +72,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
|
|||||||
|
|
||||||
Very simple! These are the steps:
|
Very simple! These are the steps:
|
||||||
|
|
||||||
- Start the container and connect to [port 5000](http://127.0.0.1:5000/) using your web browser.
|
- Start the container and connect to [port 5000](http://localhost:5000) using your web browser.
|
||||||
|
|
||||||
- Wait until DSM finishes its installation
|
- Wait until DSM finishes its installation
|
||||||
|
|
||||||
|
@ -119,12 +119,6 @@ configureDNS() {
|
|||||||
|
|
||||||
DNSMASQ_OPTS=$(echo "$DNSMASQ_OPTS" | sed 's/\t/ /g' | tr -s ' ' | sed 's/^ *//')
|
DNSMASQ_OPTS=$(echo "$DNSMASQ_OPTS" | sed 's/\t/ /g' | tr -s ' ' | sed 's/^ *//')
|
||||||
|
|
||||||
if [[ "${DEBUG_DNS:-}" == [Yy1]* ]]; then
|
|
||||||
DNSMASQ_OPTS+=" -d"
|
|
||||||
$DNSMASQ ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS} &
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! $DNSMASQ ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS}; then
|
if ! $DNSMASQ ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS}; then
|
||||||
error "Failed to start dnsmasq, reason: $?" && return 1
|
error "Failed to start dnsmasq, reason: $?" && return 1
|
||||||
fi
|
fi
|
||||||
@ -212,7 +206,7 @@ configureNAT() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! ip address add "${VM_NET_IP%.*}.1/24" broadcast "${VM_NET_IP%.*}.255" dev dockerbridge; then
|
if ! ip address add "${VM_NET_IP%.*}.1/24" broadcast "${VM_NET_IP%.*}.255" dev dockerbridge; then
|
||||||
error "Failed to add IP address pool!" && return 1
|
error "Failed to add IP address!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while ! ip link set dockerbridge up; do
|
while ! ip link set dockerbridge up; do
|
||||||
@ -261,7 +255,7 @@ configureNAT() {
|
|||||||
error "Failed to configure IP tables!" && return 1
|
error "Failed to configure IP tables!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! iptables -t nat -A PREROUTING -i "$VM_NET_DEV" -d "$IP" -p udp -j DNAT --to "$VM_NET_IP"; then
|
if ! iptables -t nat -A PREROUTING -i "$VM_NET_DEV" -d "$IP" -p udp -j DNAT --to "$VM_NET_IP"; then
|
||||||
error "Failed to configure IP tables!" && return 1
|
error "Failed to configure IP tables!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -404,16 +398,8 @@ getInfo() {
|
|||||||
error "Invalid MAC address: '$VM_NET_MAC', should be 12 or 17 digits long!" && exit 28
|
error "Invalid MAC address: '$VM_NET_MAC', should be 12 or 17 digits long!" && exit 28
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GATEWAY=$(ip route list dev "$VM_NET_DEV" | awk ' /^default/ {print $3}' | head -n 1)
|
GATEWAY=$(ip route list dev "$VM_NET_DEV" | awk ' /^default/ {print $3}')
|
||||||
IP=$(ip address show dev "$VM_NET_DEV" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/ | head -n 1)
|
IP=$(ip address show dev "$VM_NET_DEV" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
||||||
|
|
||||||
IP6=""
|
|
||||||
# shellcheck disable=SC2143
|
|
||||||
if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then
|
|
||||||
IP6=$(ip -6 addr show dev "$VM_NET_DEV" scope global up)
|
|
||||||
[ -n "$IP6" ] && IP6=$(echo "$IP6" | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | head -n 1)
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$IP" > /run/shm/qemu.ip
|
echo "$IP" > /run/shm/qemu.ip
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
@ -445,8 +431,8 @@ if [[ "$IP" == "172.17."* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "/sys/class/net/$VM_NET_TAP" ]]; then
|
if [[ -d "/sys/class/net/$VM_NET_TAP" ]]; then
|
||||||
info "Lingering interface will be removed..."
|
info "Lingering interface will be removed..."
|
||||||
ip link delete "$VM_NET_TAP" || true
|
ip link delete "$VM_NET_TAP" || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$DHCP" == [Yy1]* ]]; then
|
if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
@ -480,7 +466,7 @@ else
|
|||||||
|
|
||||||
closeBridge
|
closeBridge
|
||||||
NETWORK="user"
|
NETWORK="user"
|
||||||
warn "falling back to user-mode networking! Performance will be bad and port mapping will not work."
|
warn "falling back to usermode networking! Performance will be bad and port mapping will not work."
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -488,7 +474,7 @@ else
|
|||||||
|
|
||||||
if [[ "${NETWORK,,}" == "user"* ]]; then
|
if [[ "${NETWORK,,}" == "user"* ]]; then
|
||||||
|
|
||||||
# Configure for user-mode networking (slirp)
|
# Configure for usermode networking (slirp)
|
||||||
configureUser || exit 24
|
configureUser || exit 24
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
15
src/reset.sh
15
src/reset.sh
@ -68,8 +68,6 @@ CPU="${CPU// 8 Core/}"
|
|||||||
CPU="${CPU// 16 Core/}"
|
CPU="${CPU// 16 Core/}"
|
||||||
CPU="${CPU// 32 Core/}"
|
CPU="${CPU// 32 Core/}"
|
||||||
CPU="${CPU// 64 Core/}"
|
CPU="${CPU// 64 Core/}"
|
||||||
CPU="${CPU//10th Gen /}"
|
|
||||||
CPU="${CPU//11th Gen /}"
|
|
||||||
CPU="${CPU//12th Gen /}"
|
CPU="${CPU//12th Gen /}"
|
||||||
CPU="${CPU//13th Gen /}"
|
CPU="${CPU//13th Gen /}"
|
||||||
CPU="${CPU//14th Gen /}"
|
CPU="${CPU//14th Gen /}"
|
||||||
@ -326,19 +324,6 @@ addPackage() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2143
|
|
||||||
if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then
|
|
||||||
|
|
||||||
sed -i "s/listen 80;/listen [::]:80 ipv6only=off;/g" /etc/nginx/sites-enabled/web.conf
|
|
||||||
sed -i "s/listen 5000 default_server;/listen [::]:5000 default_server ipv6only=off;/g" /etc/nginx/sites-enabled/web.conf
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
sed -i "s/listen [::]:80 ipv6only=off;/listen 80;/g" /etc/nginx/sites-enabled/web.conf
|
|
||||||
sed -i "s/listen [::]:5000 default_server ipv6only=off;/listen 5000 default_server;/g" /etc/nginx/sites-enabled/web.conf
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start webserver
|
# Start webserver
|
||||||
cp -r /var/www/* /run/shm
|
cp -r /var/www/* /run/shm
|
||||||
html "Starting $APP for Docker..."
|
html "Starting $APP for Docker..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user