How can I run a VM on a diskstation DS218 from an external drive
The virtual machine manager package from synology (version 2.3.1-8926) does not allow me to run a VM from a USB drive.
I would like to load the virtual machine image from a external disk so that the SHR BTRFS drives are not busy with the image.
How can I use an external disk with this NAS to load the vdisk?
synology
add a comment |
The virtual machine manager package from synology (version 2.3.1-8926) does not allow me to run a VM from a USB drive.
I would like to load the virtual machine image from a external disk so that the SHR BTRFS drives are not busy with the image.
How can I use an external disk with this NAS to load the vdisk?
synology
add a comment |
The virtual machine manager package from synology (version 2.3.1-8926) does not allow me to run a VM from a USB drive.
I would like to load the virtual machine image from a external disk so that the SHR BTRFS drives are not busy with the image.
How can I use an external disk with this NAS to load the vdisk?
synology
The virtual machine manager package from synology (version 2.3.1-8926) does not allow me to run a VM from a USB drive.
I would like to load the virtual machine image from a external disk so that the SHR BTRFS drives are not busy with the image.
How can I use an external disk with this NAS to load the vdisk?
synology
synology
edited Jun 19 '18 at 22:04
asked May 31 '18 at 21:46
Mathias Florin
1065
1065
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I wanted to load a VM from a USB stick / msata sdd as I thought this could provide a performance boost for the NAS as the hdd disks are not busy. In a nutshell, the performance with my USB 3 MSATA drive is snappy and good enough for light web browsing.
Here are my findings on how to do this (boot VM from USB drive) on my DS218+ and also some additional thoughts about the VM performance.
First of all, I created a Windows 7 VM with virtio network interface (you can select this in the VM virtual machine manager). Windows 7 was mentioned on the Synology forum to perform better than Win 10 so I tried with this version.
In the VM network settings you need to click the gear and select the virtio network adapter. This is important as you will not have a network connection later on. Once the machine has been installed you need to download the virtio drivers from here virtio network driver and mount the image.
You also need to open the device manager on your guest and update the ethernet driver (the driver is in the NetKVM folder).
The machine can be shutdown when you have done the steps above and you are sure that you use the Redhat virtio network interface and you do have internet access with it.
You now need to start a SSH session and make yourself root with
sudo -i
As root cd into
cd /volume1/@iSCSI/LUN/VDISK_BLUN/.
Here you can check the sub directories with
ls -allhd */*
for all your VMs and the image you would like to copy to the USB stick. Copy the image from the subdirectory with cp to the root drive of your USB stick /volumeUSB1/usbshare/. If your USB drive is not detected in the NAS you can go to Control Panel -> External devices to format the drive as EXT4. You should keep a backup of your data before you format the stick.
After the vdisk image has been copied, you need to configure your network to route the IP traffic for the VM with:
ip tuntap add name tap0 mode tap;ifconfig tap0 up;ovs-vsctl add-port ovs_eth0 tap0
Now start qemu with:
/usr/local/bin/qemu-system-x86_64 -drive
format=raw,file=/volumeUSB1/usbshare/vdisk.f6584cf5-6567-49c7-af33-d7f055c62bb4.a5bf8508-d623-4620-ad79-6c83cf143204.2.0_00000
-m 3000 -vnc :0 -mem-prealloc -mem-path /dev/virtualization/win7 -machine pc-i440fx-2.2,accel=kvm,usb=off
-netdev tap,ifname=tap0,script=no,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=02:11:32:25:64:a7,bus=pci.0,addr=0x3
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -cpu host -smp 10
In the code above you need to change the vdisk filename to your image. The mem-path can also be updated to /tmp/W7 if you like. Adjust the -m argument to your memory (I configured 3000mb).
When qemu is running, you can ssh in with a second connection and check with top whether qemu is running and if so how much memory and cpu it uses.
Finally, use a VNC viewer to connect to the IP of the diskstation at port 5900 to get the Windows Desktop environment. I'd also recommend to set up remote desktop instead of using a VNC client.
If you want to use VMM again, you can remove the tap0 device from the bridge with:
ovs-vsctl del-port ovs_eth0 tap0
Overall I am satisfied with the performance from a USB stick. The USB stick version is definitely good enough for occasional browsing. Additionally I tested with my evo msata drive in a USB 3 enclosure. I had the impression that the EVO disk performed a tad better.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f447216%2fhow-can-i-run-a-vm-on-a-diskstation-ds218-from-an-external-drive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I wanted to load a VM from a USB stick / msata sdd as I thought this could provide a performance boost for the NAS as the hdd disks are not busy. In a nutshell, the performance with my USB 3 MSATA drive is snappy and good enough for light web browsing.
Here are my findings on how to do this (boot VM from USB drive) on my DS218+ and also some additional thoughts about the VM performance.
First of all, I created a Windows 7 VM with virtio network interface (you can select this in the VM virtual machine manager). Windows 7 was mentioned on the Synology forum to perform better than Win 10 so I tried with this version.
In the VM network settings you need to click the gear and select the virtio network adapter. This is important as you will not have a network connection later on. Once the machine has been installed you need to download the virtio drivers from here virtio network driver and mount the image.
You also need to open the device manager on your guest and update the ethernet driver (the driver is in the NetKVM folder).
The machine can be shutdown when you have done the steps above and you are sure that you use the Redhat virtio network interface and you do have internet access with it.
You now need to start a SSH session and make yourself root with
sudo -i
As root cd into
cd /volume1/@iSCSI/LUN/VDISK_BLUN/.
Here you can check the sub directories with
ls -allhd */*
for all your VMs and the image you would like to copy to the USB stick. Copy the image from the subdirectory with cp to the root drive of your USB stick /volumeUSB1/usbshare/. If your USB drive is not detected in the NAS you can go to Control Panel -> External devices to format the drive as EXT4. You should keep a backup of your data before you format the stick.
After the vdisk image has been copied, you need to configure your network to route the IP traffic for the VM with:
ip tuntap add name tap0 mode tap;ifconfig tap0 up;ovs-vsctl add-port ovs_eth0 tap0
Now start qemu with:
/usr/local/bin/qemu-system-x86_64 -drive
format=raw,file=/volumeUSB1/usbshare/vdisk.f6584cf5-6567-49c7-af33-d7f055c62bb4.a5bf8508-d623-4620-ad79-6c83cf143204.2.0_00000
-m 3000 -vnc :0 -mem-prealloc -mem-path /dev/virtualization/win7 -machine pc-i440fx-2.2,accel=kvm,usb=off
-netdev tap,ifname=tap0,script=no,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=02:11:32:25:64:a7,bus=pci.0,addr=0x3
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -cpu host -smp 10
In the code above you need to change the vdisk filename to your image. The mem-path can also be updated to /tmp/W7 if you like. Adjust the -m argument to your memory (I configured 3000mb).
When qemu is running, you can ssh in with a second connection and check with top whether qemu is running and if so how much memory and cpu it uses.
Finally, use a VNC viewer to connect to the IP of the diskstation at port 5900 to get the Windows Desktop environment. I'd also recommend to set up remote desktop instead of using a VNC client.
If you want to use VMM again, you can remove the tap0 device from the bridge with:
ovs-vsctl del-port ovs_eth0 tap0
Overall I am satisfied with the performance from a USB stick. The USB stick version is definitely good enough for occasional browsing. Additionally I tested with my evo msata drive in a USB 3 enclosure. I had the impression that the EVO disk performed a tad better.
add a comment |
I wanted to load a VM from a USB stick / msata sdd as I thought this could provide a performance boost for the NAS as the hdd disks are not busy. In a nutshell, the performance with my USB 3 MSATA drive is snappy and good enough for light web browsing.
Here are my findings on how to do this (boot VM from USB drive) on my DS218+ and also some additional thoughts about the VM performance.
First of all, I created a Windows 7 VM with virtio network interface (you can select this in the VM virtual machine manager). Windows 7 was mentioned on the Synology forum to perform better than Win 10 so I tried with this version.
In the VM network settings you need to click the gear and select the virtio network adapter. This is important as you will not have a network connection later on. Once the machine has been installed you need to download the virtio drivers from here virtio network driver and mount the image.
You also need to open the device manager on your guest and update the ethernet driver (the driver is in the NetKVM folder).
The machine can be shutdown when you have done the steps above and you are sure that you use the Redhat virtio network interface and you do have internet access with it.
You now need to start a SSH session and make yourself root with
sudo -i
As root cd into
cd /volume1/@iSCSI/LUN/VDISK_BLUN/.
Here you can check the sub directories with
ls -allhd */*
for all your VMs and the image you would like to copy to the USB stick. Copy the image from the subdirectory with cp to the root drive of your USB stick /volumeUSB1/usbshare/. If your USB drive is not detected in the NAS you can go to Control Panel -> External devices to format the drive as EXT4. You should keep a backup of your data before you format the stick.
After the vdisk image has been copied, you need to configure your network to route the IP traffic for the VM with:
ip tuntap add name tap0 mode tap;ifconfig tap0 up;ovs-vsctl add-port ovs_eth0 tap0
Now start qemu with:
/usr/local/bin/qemu-system-x86_64 -drive
format=raw,file=/volumeUSB1/usbshare/vdisk.f6584cf5-6567-49c7-af33-d7f055c62bb4.a5bf8508-d623-4620-ad79-6c83cf143204.2.0_00000
-m 3000 -vnc :0 -mem-prealloc -mem-path /dev/virtualization/win7 -machine pc-i440fx-2.2,accel=kvm,usb=off
-netdev tap,ifname=tap0,script=no,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=02:11:32:25:64:a7,bus=pci.0,addr=0x3
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -cpu host -smp 10
In the code above you need to change the vdisk filename to your image. The mem-path can also be updated to /tmp/W7 if you like. Adjust the -m argument to your memory (I configured 3000mb).
When qemu is running, you can ssh in with a second connection and check with top whether qemu is running and if so how much memory and cpu it uses.
Finally, use a VNC viewer to connect to the IP of the diskstation at port 5900 to get the Windows Desktop environment. I'd also recommend to set up remote desktop instead of using a VNC client.
If you want to use VMM again, you can remove the tap0 device from the bridge with:
ovs-vsctl del-port ovs_eth0 tap0
Overall I am satisfied with the performance from a USB stick. The USB stick version is definitely good enough for occasional browsing. Additionally I tested with my evo msata drive in a USB 3 enclosure. I had the impression that the EVO disk performed a tad better.
add a comment |
I wanted to load a VM from a USB stick / msata sdd as I thought this could provide a performance boost for the NAS as the hdd disks are not busy. In a nutshell, the performance with my USB 3 MSATA drive is snappy and good enough for light web browsing.
Here are my findings on how to do this (boot VM from USB drive) on my DS218+ and also some additional thoughts about the VM performance.
First of all, I created a Windows 7 VM with virtio network interface (you can select this in the VM virtual machine manager). Windows 7 was mentioned on the Synology forum to perform better than Win 10 so I tried with this version.
In the VM network settings you need to click the gear and select the virtio network adapter. This is important as you will not have a network connection later on. Once the machine has been installed you need to download the virtio drivers from here virtio network driver and mount the image.
You also need to open the device manager on your guest and update the ethernet driver (the driver is in the NetKVM folder).
The machine can be shutdown when you have done the steps above and you are sure that you use the Redhat virtio network interface and you do have internet access with it.
You now need to start a SSH session and make yourself root with
sudo -i
As root cd into
cd /volume1/@iSCSI/LUN/VDISK_BLUN/.
Here you can check the sub directories with
ls -allhd */*
for all your VMs and the image you would like to copy to the USB stick. Copy the image from the subdirectory with cp to the root drive of your USB stick /volumeUSB1/usbshare/. If your USB drive is not detected in the NAS you can go to Control Panel -> External devices to format the drive as EXT4. You should keep a backup of your data before you format the stick.
After the vdisk image has been copied, you need to configure your network to route the IP traffic for the VM with:
ip tuntap add name tap0 mode tap;ifconfig tap0 up;ovs-vsctl add-port ovs_eth0 tap0
Now start qemu with:
/usr/local/bin/qemu-system-x86_64 -drive
format=raw,file=/volumeUSB1/usbshare/vdisk.f6584cf5-6567-49c7-af33-d7f055c62bb4.a5bf8508-d623-4620-ad79-6c83cf143204.2.0_00000
-m 3000 -vnc :0 -mem-prealloc -mem-path /dev/virtualization/win7 -machine pc-i440fx-2.2,accel=kvm,usb=off
-netdev tap,ifname=tap0,script=no,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=02:11:32:25:64:a7,bus=pci.0,addr=0x3
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -cpu host -smp 10
In the code above you need to change the vdisk filename to your image. The mem-path can also be updated to /tmp/W7 if you like. Adjust the -m argument to your memory (I configured 3000mb).
When qemu is running, you can ssh in with a second connection and check with top whether qemu is running and if so how much memory and cpu it uses.
Finally, use a VNC viewer to connect to the IP of the diskstation at port 5900 to get the Windows Desktop environment. I'd also recommend to set up remote desktop instead of using a VNC client.
If you want to use VMM again, you can remove the tap0 device from the bridge with:
ovs-vsctl del-port ovs_eth0 tap0
Overall I am satisfied with the performance from a USB stick. The USB stick version is definitely good enough for occasional browsing. Additionally I tested with my evo msata drive in a USB 3 enclosure. I had the impression that the EVO disk performed a tad better.
I wanted to load a VM from a USB stick / msata sdd as I thought this could provide a performance boost for the NAS as the hdd disks are not busy. In a nutshell, the performance with my USB 3 MSATA drive is snappy and good enough for light web browsing.
Here are my findings on how to do this (boot VM from USB drive) on my DS218+ and also some additional thoughts about the VM performance.
First of all, I created a Windows 7 VM with virtio network interface (you can select this in the VM virtual machine manager). Windows 7 was mentioned on the Synology forum to perform better than Win 10 so I tried with this version.
In the VM network settings you need to click the gear and select the virtio network adapter. This is important as you will not have a network connection later on. Once the machine has been installed you need to download the virtio drivers from here virtio network driver and mount the image.
You also need to open the device manager on your guest and update the ethernet driver (the driver is in the NetKVM folder).
The machine can be shutdown when you have done the steps above and you are sure that you use the Redhat virtio network interface and you do have internet access with it.
You now need to start a SSH session and make yourself root with
sudo -i
As root cd into
cd /volume1/@iSCSI/LUN/VDISK_BLUN/.
Here you can check the sub directories with
ls -allhd */*
for all your VMs and the image you would like to copy to the USB stick. Copy the image from the subdirectory with cp to the root drive of your USB stick /volumeUSB1/usbshare/. If your USB drive is not detected in the NAS you can go to Control Panel -> External devices to format the drive as EXT4. You should keep a backup of your data before you format the stick.
After the vdisk image has been copied, you need to configure your network to route the IP traffic for the VM with:
ip tuntap add name tap0 mode tap;ifconfig tap0 up;ovs-vsctl add-port ovs_eth0 tap0
Now start qemu with:
/usr/local/bin/qemu-system-x86_64 -drive
format=raw,file=/volumeUSB1/usbshare/vdisk.f6584cf5-6567-49c7-af33-d7f055c62bb4.a5bf8508-d623-4620-ad79-6c83cf143204.2.0_00000
-m 3000 -vnc :0 -mem-prealloc -mem-path /dev/virtualization/win7 -machine pc-i440fx-2.2,accel=kvm,usb=off
-netdev tap,ifname=tap0,script=no,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=02:11:32:25:64:a7,bus=pci.0,addr=0x3
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -cpu host -smp 10
In the code above you need to change the vdisk filename to your image. The mem-path can also be updated to /tmp/W7 if you like. Adjust the -m argument to your memory (I configured 3000mb).
When qemu is running, you can ssh in with a second connection and check with top whether qemu is running and if so how much memory and cpu it uses.
Finally, use a VNC viewer to connect to the IP of the diskstation at port 5900 to get the Windows Desktop environment. I'd also recommend to set up remote desktop instead of using a VNC client.
If you want to use VMM again, you can remove the tap0 device from the bridge with:
ovs-vsctl del-port ovs_eth0 tap0
Overall I am satisfied with the performance from a USB stick. The USB stick version is definitely good enough for occasional browsing. Additionally I tested with my evo msata drive in a USB 3 enclosure. I had the impression that the EVO disk performed a tad better.
edited Jun 27 '18 at 6:53
answered May 31 '18 at 21:56
Mathias Florin
1065
1065
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f447216%2fhow-can-i-run-a-vm-on-a-diskstation-ds218-from-an-external-drive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown