Yes there is a connection between endogenous retrovirus and diabetes. There is a evidence that Human Endogenous retrovirus (HERV)-K18 which causes the diabetes type I. HERV-K18 encodes for a T-cell superantigen (SAg). HERV-K18 transcription and SAg function in cells capable of efficient presentation are induced by proinflammatory stimuli such as viruses and interferon-alpha and may trigger progression of disease from insulitis to overt diabetes.
There is/was a clinical trial on fecal transplants as a potential cure for diabetes type II. Not sure what evidence that was based on, but the supposition being tested was that origins were in the microbial flora of the large intestine. I think that there is some evidence that Metformin affects the microbial flora as well. I never saw the outcome of this work. There are also two issues to address for endogenous retroviruses. There is insulin production, perhaps related to type I islet cell issues, perhaps not. Then there is insulin resistance in the fat cells, presumably related to structural changes in the insulin receptor cascade.
Human endogenous retrovirus (HERV)- encodes T-cell superantigen (SAg), and T-cells with HERV-K18 SAg reactive T-cell receptor Vβ7 chains were found to be enriched in the pancreas, in the spleen which enhanced in inflammatory lesions of patients with recent-onset type 1 diabetes.