Reset a USB Modem without physical access (KVM virtual machine)
ubuntu community,
im using a usb-modem to connect a virtual machine with the internet. So host and guest do not share the same ip/network. I emulate by qemu-kvm, device forwarding works great with "-usb -usbdevice host:1c9e:9603". The VM uses Ubuntu 10.04, Host 11.10.
Unfortunately the modem unmounts after ~3 days. Obviously, from now on no connection can be established. After the VM reboots, a connection is possible again.
Nmcli can be used to establish an internet connection and check whether its still active.
But how do I remount the device/modem with a small bash script?
Syslog showing, how the device unplugs after being ~3days in use:
pppd[1369]: LCP terminated by peer
pppd[1369]: Connect time 1104.9 minutes.
pppd[1369]: Sent 1279 bytes, received 790 bytes.
kernel: [66423.705380] device ppp0 left promiscuous mode
pppd[1369]: Modem hangup
pppd[1369]: Connection terminated.
avahi-daemon[424]: Withdrawing workstation service for ppp0.
modem-manager[483]: (ttyUSB2) closing serial port...
NetworkManager[431]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
NetworkManager[431]: (ttyUSB2): now unmanaged
NetworkManager[431]: (ttyUSB2): device state change: 8 -> 1 (reason 36)
NetworkManager[431]: (ttyUSB2): deactivating device (reason: 36).
NetworkManager[431]: could not read ppp stats: No such device
NetworkManager[431]: (ttyUSB2): cleaning up...
NetworkManager[431]: (ttyUSB2): taking down device.
NetworkManager[431]: Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
nm-dispatcher.action: Error in get_property: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist#012
modem-manager[483]: (ttyUSB2) serial port closed
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (connected -> disconnecting)
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disconnecting -> connected)
pppd[1369]: Exit.
NetworkManager[431]: disconnect failed: (32) The serial port is not open.
I am afraid, that restarting the usb-deamons on the VM will not be enough - as I will have to tell the qemuKVM-Manager to forward the device once again. But that would be the second step.
Regards.
usb restart kvm usb-modem
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
ubuntu community,
im using a usb-modem to connect a virtual machine with the internet. So host and guest do not share the same ip/network. I emulate by qemu-kvm, device forwarding works great with "-usb -usbdevice host:1c9e:9603". The VM uses Ubuntu 10.04, Host 11.10.
Unfortunately the modem unmounts after ~3 days. Obviously, from now on no connection can be established. After the VM reboots, a connection is possible again.
Nmcli can be used to establish an internet connection and check whether its still active.
But how do I remount the device/modem with a small bash script?
Syslog showing, how the device unplugs after being ~3days in use:
pppd[1369]: LCP terminated by peer
pppd[1369]: Connect time 1104.9 minutes.
pppd[1369]: Sent 1279 bytes, received 790 bytes.
kernel: [66423.705380] device ppp0 left promiscuous mode
pppd[1369]: Modem hangup
pppd[1369]: Connection terminated.
avahi-daemon[424]: Withdrawing workstation service for ppp0.
modem-manager[483]: (ttyUSB2) closing serial port...
NetworkManager[431]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
NetworkManager[431]: (ttyUSB2): now unmanaged
NetworkManager[431]: (ttyUSB2): device state change: 8 -> 1 (reason 36)
NetworkManager[431]: (ttyUSB2): deactivating device (reason: 36).
NetworkManager[431]: could not read ppp stats: No such device
NetworkManager[431]: (ttyUSB2): cleaning up...
NetworkManager[431]: (ttyUSB2): taking down device.
NetworkManager[431]: Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
nm-dispatcher.action: Error in get_property: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist#012
modem-manager[483]: (ttyUSB2) serial port closed
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (connected -> disconnecting)
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disconnecting -> connected)
pppd[1369]: Exit.
NetworkManager[431]: disconnect failed: (32) The serial port is not open.
I am afraid, that restarting the usb-deamons on the VM will not be enough - as I will have to tell the qemuKVM-Manager to forward the device once again. But that would be the second step.
Regards.
usb restart kvm usb-modem
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Are you saying that the USB device disappears from the guest after 3 days? If so, it's a bug, and it could easily be on either side. Like the USB device could encounter an error condition, perform a bus reset, and that reset takes it offline. All you're seeing from the VM + passthrough is the device in unavailable. My gut tells me this may be a USB powersave issue, or a flaky USB device. This old external USR serial modems are good for something, rock solid reliability, and real serial ports usually don't have bus reset problems.
– ppetraki
Mar 29 '12 at 13:26
add a comment |
ubuntu community,
im using a usb-modem to connect a virtual machine with the internet. So host and guest do not share the same ip/network. I emulate by qemu-kvm, device forwarding works great with "-usb -usbdevice host:1c9e:9603". The VM uses Ubuntu 10.04, Host 11.10.
Unfortunately the modem unmounts after ~3 days. Obviously, from now on no connection can be established. After the VM reboots, a connection is possible again.
Nmcli can be used to establish an internet connection and check whether its still active.
But how do I remount the device/modem with a small bash script?
Syslog showing, how the device unplugs after being ~3days in use:
pppd[1369]: LCP terminated by peer
pppd[1369]: Connect time 1104.9 minutes.
pppd[1369]: Sent 1279 bytes, received 790 bytes.
kernel: [66423.705380] device ppp0 left promiscuous mode
pppd[1369]: Modem hangup
pppd[1369]: Connection terminated.
avahi-daemon[424]: Withdrawing workstation service for ppp0.
modem-manager[483]: (ttyUSB2) closing serial port...
NetworkManager[431]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
NetworkManager[431]: (ttyUSB2): now unmanaged
NetworkManager[431]: (ttyUSB2): device state change: 8 -> 1 (reason 36)
NetworkManager[431]: (ttyUSB2): deactivating device (reason: 36).
NetworkManager[431]: could not read ppp stats: No such device
NetworkManager[431]: (ttyUSB2): cleaning up...
NetworkManager[431]: (ttyUSB2): taking down device.
NetworkManager[431]: Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
nm-dispatcher.action: Error in get_property: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist#012
modem-manager[483]: (ttyUSB2) serial port closed
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (connected -> disconnecting)
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disconnecting -> connected)
pppd[1369]: Exit.
NetworkManager[431]: disconnect failed: (32) The serial port is not open.
I am afraid, that restarting the usb-deamons on the VM will not be enough - as I will have to tell the qemuKVM-Manager to forward the device once again. But that would be the second step.
Regards.
usb restart kvm usb-modem
ubuntu community,
im using a usb-modem to connect a virtual machine with the internet. So host and guest do not share the same ip/network. I emulate by qemu-kvm, device forwarding works great with "-usb -usbdevice host:1c9e:9603". The VM uses Ubuntu 10.04, Host 11.10.
Unfortunately the modem unmounts after ~3 days. Obviously, from now on no connection can be established. After the VM reboots, a connection is possible again.
Nmcli can be used to establish an internet connection and check whether its still active.
But how do I remount the device/modem with a small bash script?
Syslog showing, how the device unplugs after being ~3days in use:
pppd[1369]: LCP terminated by peer
pppd[1369]: Connect time 1104.9 minutes.
pppd[1369]: Sent 1279 bytes, received 790 bytes.
kernel: [66423.705380] device ppp0 left promiscuous mode
pppd[1369]: Modem hangup
pppd[1369]: Connection terminated.
avahi-daemon[424]: Withdrawing workstation service for ppp0.
modem-manager[483]: (ttyUSB2) closing serial port...
NetworkManager[431]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
NetworkManager[431]: (ttyUSB2): now unmanaged
NetworkManager[431]: (ttyUSB2): device state change: 8 -> 1 (reason 36)
NetworkManager[431]: (ttyUSB2): deactivating device (reason: 36).
NetworkManager[431]: could not read ppp stats: No such device
NetworkManager[431]: (ttyUSB2): cleaning up...
NetworkManager[431]: (ttyUSB2): taking down device.
NetworkManager[431]: Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
nm-dispatcher.action: Error in get_property: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist#012
modem-manager[483]: (ttyUSB2) serial port closed
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (connected -> disconnecting)
modem-manager[483]: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disconnecting -> connected)
pppd[1369]: Exit.
NetworkManager[431]: disconnect failed: (32) The serial port is not open.
I am afraid, that restarting the usb-deamons on the VM will not be enough - as I will have to tell the qemuKVM-Manager to forward the device once again. But that would be the second step.
Regards.
usb restart kvm usb-modem
usb restart kvm usb-modem
asked Mar 23 '12 at 12:52
MarcinMarcin
612
612
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Are you saying that the USB device disappears from the guest after 3 days? If so, it's a bug, and it could easily be on either side. Like the USB device could encounter an error condition, perform a bus reset, and that reset takes it offline. All you're seeing from the VM + passthrough is the device in unavailable. My gut tells me this may be a USB powersave issue, or a flaky USB device. This old external USR serial modems are good for something, rock solid reliability, and real serial ports usually don't have bus reset problems.
– ppetraki
Mar 29 '12 at 13:26
add a comment |
Are you saying that the USB device disappears from the guest after 3 days? If so, it's a bug, and it could easily be on either side. Like the USB device could encounter an error condition, perform a bus reset, and that reset takes it offline. All you're seeing from the VM + passthrough is the device in unavailable. My gut tells me this may be a USB powersave issue, or a flaky USB device. This old external USR serial modems are good for something, rock solid reliability, and real serial ports usually don't have bus reset problems.
– ppetraki
Mar 29 '12 at 13:26
Are you saying that the USB device disappears from the guest after 3 days? If so, it's a bug, and it could easily be on either side. Like the USB device could encounter an error condition, perform a bus reset, and that reset takes it offline. All you're seeing from the VM + passthrough is the device in unavailable. My gut tells me this may be a USB powersave issue, or a flaky USB device. This old external USR serial modems are good for something, rock solid reliability, and real serial ports usually don't have bus reset problems.
– ppetraki
Mar 29 '12 at 13:26
Are you saying that the USB device disappears from the guest after 3 days? If so, it's a bug, and it could easily be on either side. Like the USB device could encounter an error condition, perform a bus reset, and that reset takes it offline. All you're seeing from the VM + passthrough is the device in unavailable. My gut tells me this may be a USB powersave issue, or a flaky USB device. This old external USR serial modems are good for something, rock solid reliability, and real serial ports usually don't have bus reset problems.
– ppetraki
Mar 29 '12 at 13:26
add a comment |
1 Answer
1
active
oldest
votes
I have tried this http://marc.info/?l=linux-usb&m=121459435621262&w=2 c-programm to reset usb.
$ cc usbreset.c -o usbreset
$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO
$ chmod +x usbreset
$ sudo ./usbreset /dev/bus/usb/002/003
The UMTS Modem disappears for ~20 secs and appears again in the VM.
Fortunately, it is redirected automatically by the qemu manager!
The problem is still NOT solved, as after 3 days even this usb reset will not allow me to establish a well-functioning connection.
A reboot of the VM is my last resort...
@ppetraki:
The modem does not disappear from the network manager, its
still there, no connection can be established though.
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enterATand press enter, if you don't see anOKthen you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8
– ppetraki
Apr 12 '12 at 15:09
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f115373%2freset-a-usb-modem-without-physical-access-kvm-virtual-machine%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 have tried this http://marc.info/?l=linux-usb&m=121459435621262&w=2 c-programm to reset usb.
$ cc usbreset.c -o usbreset
$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO
$ chmod +x usbreset
$ sudo ./usbreset /dev/bus/usb/002/003
The UMTS Modem disappears for ~20 secs and appears again in the VM.
Fortunately, it is redirected automatically by the qemu manager!
The problem is still NOT solved, as after 3 days even this usb reset will not allow me to establish a well-functioning connection.
A reboot of the VM is my last resort...
@ppetraki:
The modem does not disappear from the network manager, its
still there, no connection can be established though.
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enterATand press enter, if you don't see anOKthen you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8
– ppetraki
Apr 12 '12 at 15:09
add a comment |
I have tried this http://marc.info/?l=linux-usb&m=121459435621262&w=2 c-programm to reset usb.
$ cc usbreset.c -o usbreset
$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO
$ chmod +x usbreset
$ sudo ./usbreset /dev/bus/usb/002/003
The UMTS Modem disappears for ~20 secs and appears again in the VM.
Fortunately, it is redirected automatically by the qemu manager!
The problem is still NOT solved, as after 3 days even this usb reset will not allow me to establish a well-functioning connection.
A reboot of the VM is my last resort...
@ppetraki:
The modem does not disappear from the network manager, its
still there, no connection can be established though.
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enterATand press enter, if you don't see anOKthen you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8
– ppetraki
Apr 12 '12 at 15:09
add a comment |
I have tried this http://marc.info/?l=linux-usb&m=121459435621262&w=2 c-programm to reset usb.
$ cc usbreset.c -o usbreset
$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO
$ chmod +x usbreset
$ sudo ./usbreset /dev/bus/usb/002/003
The UMTS Modem disappears for ~20 secs and appears again in the VM.
Fortunately, it is redirected automatically by the qemu manager!
The problem is still NOT solved, as after 3 days even this usb reset will not allow me to establish a well-functioning connection.
A reboot of the VM is my last resort...
@ppetraki:
The modem does not disappear from the network manager, its
still there, no connection can be established though.
I have tried this http://marc.info/?l=linux-usb&m=121459435621262&w=2 c-programm to reset usb.
$ cc usbreset.c -o usbreset
$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO
$ chmod +x usbreset
$ sudo ./usbreset /dev/bus/usb/002/003
The UMTS Modem disappears for ~20 secs and appears again in the VM.
Fortunately, it is redirected automatically by the qemu manager!
The problem is still NOT solved, as after 3 days even this usb reset will not allow me to establish a well-functioning connection.
A reboot of the VM is my last resort...
@ppetraki:
The modem does not disappear from the network manager, its
still there, no connection can be established though.
edited Mar 31 '12 at 18:28
Community♦
1
1
answered Mar 30 '12 at 14:10
MarcinMarcin
1
1
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enterATand press enter, if you don't see anOKthen you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8
– ppetraki
Apr 12 '12 at 15:09
add a comment |
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enterATand press enter, if you don't see anOKthen you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8
– ppetraki
Apr 12 '12 at 15:09
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enter
AT and press enter, if you don't see an OK then you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8– ppetraki
Apr 12 '12 at 15:09
Remember, this is just a serial port. In your VM you should be able to find it in /dev as a plan ttySn or ttyUSBSn device. If you can't chat with it with minicom, kermit, or wvdial, it doesn't matter what NM thinks as it might be working with a stale handle. You need to verify that the serial device is actually responding, open it with minicom and enter
AT and press enter, if you don't see an OK then you have more troubleshooting to do. See tldp.org/HOWTO/html_single/Modem-HOWTO/#s8– ppetraki
Apr 12 '12 at 15:09
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f115373%2freset-a-usb-modem-without-physical-access-kvm-virtual-machine%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
Are you saying that the USB device disappears from the guest after 3 days? If so, it's a bug, and it could easily be on either side. Like the USB device could encounter an error condition, perform a bus reset, and that reset takes it offline. All you're seeing from the VM + passthrough is the device in unavailable. My gut tells me this may be a USB powersave issue, or a flaky USB device. This old external USR serial modems are good for something, rock solid reliability, and real serial ports usually don't have bus reset problems.
– ppetraki
Mar 29 '12 at 13:26